14 int main(int argc
, char *argv
[], char *envp
[]);
15 int diff(char *s1
, char *s2
);
18 int main(argc
, argv
, envp
)
20 char *argv
[], *envp
[];
22 /* See if arguments passed ok. */
26 if (diff(argv
[0], "t11a")) e(21);
27 if (diff(argv
[1], "arg0")) e(22);
28 if (diff(argv
[2], "arg1")) e(23);
29 if (diff(argv
[3], "arg2")) e(24);
30 if (diff(envp
[0], "spring")) e(25);
31 if (diff(envp
[1], "summer")) e(26);
34 /* Now see if the files are ok. */
35 if (read(3, aa
, 4) != 2) e(28);
36 if (aa
[0] != 7 || aa
[1] != 9) e(29);
38 if (getuid() == 10) e(30);
39 if (geteuid() != 10) e(31);
40 if (getgid() == 20) e(32);
41 if (getegid() != 20) e(33);
43 if (open("t1", 0) < 0) e(34);
44 if (open("t2", 0) < 0) e(35);
52 if (*s1
== 0 && *s2
== 0) return(0);
53 if (*s1
!= *s2
) return (1);
62 printf("Subtest %d, error %d errno=%d ", subtest
, n
, errno
);
64 if (errct
++ > MAX_ERROR
) {
65 printf("Too many errors; test aborted\n");
67 system("rm -rf DIR*");