lkml.org 
[lkml]   [1999]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] replacing "/dev/root" in /proc/mounts
From
Date
Erik Andersen <andersen@xmission.com> writes:

|> #include <stdio.h>
|> #include <sys/stat.h>
|> #include <unistd.h>
|> int main(int argc, char **argv)
|> {
|> struct stat statBuf;
|> unsigned int major, minor;
|> stat("/", &statBuf);
|> major=minor=statBuf.st_dev;
|> printf("/ is on device major %d, minor %d\n",
|> major>>8, minor&0xff);

This is bad, you should be using the major and minor macros.

--
Andreas Schwab "And now for something
SuSE Labs completely different."
schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.365 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site