mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-12-21 23:29:16 +00:00
initial checkin
This commit is contained in:
parent
91a111f2c1
commit
314f3fcee0
28
lib/libc/tests/gen/getlogin.c
Normal file
28
lib/libc/tests/gen/getlogin.c
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Tests getlogin(2) and setlogin(2).
|
||||||
|
* Devin Reade, 1997.
|
||||||
|
*
|
||||||
|
* $Id: getlogin.c,v 1.1 1997/09/21 16:32:15 gdr Exp $
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char **argv) {
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
p = getlogin();
|
||||||
|
printf("first getlogin() returns \"%s\"\n", (p == NULL)? "(null)" : p);
|
||||||
|
|
||||||
|
if (setlogin("bork") < 0) {
|
||||||
|
perror("setlogin failed");
|
||||||
|
} else {
|
||||||
|
printf("setlogin passed\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
p = getlogin();
|
||||||
|
printf("second getlogin() returns \"%s\"\n", (p == NULL)? "(null)" : p);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user