Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 116745 Details for
Bug 175243
/proc/mounts references /dev/root for / but /dev/root does not exist
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
blockdev_is_root.c
blockdev_is_root.c (text/plain), 1.02 KB, created by
Matthias Schwarzott
on 2007-04-19 17:28:54 UTC
(
hide
)
Description:
blockdev_is_root.c
Filename:
MIME Type:
Creator:
Matthias Schwarzott
Created:
2007-04-19 17:28:54 UTC
Size:
1.02 KB
patch
obsolete
>// compare MAJOR/MINOR in environment with the device >// / is mounted on >// >// Author: Matthias Schwarzott <zzam@gentoo.org> > >#include <sys/types.h> >#include <sys/stat.h> >#include <unistd.h> > >#include <stdio.h> >#include <stdlib.h> > >// Getting major/minor >#include <sys/sysmacros.h> >int main(int argc, char **argv) >{ > struct stat stat_buf; > unsigned int root_major=0, root_minor=0; > unsigned int dev_major=0, dev_minor=0; > char *t; > > t=getenv("MAJOR"); > if (!t) > return EXIT_FAILURE; > else > dev_major=strtol(t, NULL, 10); > > t=getenv("MINOR"); > if (!t) > return EXIT_FAILURE; > else > dev_minor=strtol(t, NULL, 10); > > > if (stat("/", &stat_buf)<0) > return EXIT_FAILURE; > > root_major=major(stat_buf.st_dev); > root_minor=minor(stat_buf.st_dev); > > > // printf("ROOT: %d / %d \n", root_major, root_minor); > // printf("DEV: %d / %d \n", dev_major, dev_minor); > > if (!root_major || !dev_major) { > printf("MAJOR==0\n"); > return EXIT_FAILURE; > } > > if ( (root_major==dev_major) && (root_minor==dev_minor)) > return EXIT_SUCCESS; > > return EXIT_FAILURE; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 175243
: 116745 |
116919