Magellan Linux

Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/tests/environ.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 472 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <unistd.h>
4
5 int main(int argc, char *argv[], char *envp[])
6 {
7 int i;
8
9 /* Verify envp == environ */
10 printf("Verifying envp == environ... %s\n",
11 (envp == environ) ? "ok" : "ERROR");
12
13 /* Test argc/argv */
14 printf("argc = %d, argv = %p\n", argc, argv);
15 for (i = 0; i < argc; i++) {
16 printf("argv[%2d] = %s\n", i, argv[i]);
17 }
18
19 /* Test environ */
20 for (i = 0; envp[i]; i++)
21 printf("%s\n", envp[i]);
22
23 return 0;
24 }