Messages in this thread | | | Subject | Re: [patch] replacing "/dev/root" in /proc/mounts | From | Andreas Schwab <> | Date | 08 Oct 1999 09:44:05 +0200 |
| |
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/
| |