// program 1-7 file/testerror.c
#include "apue.h"
#include <errno.h>
int main(int argc, char *argv[])
{
fprintf(stderr, "EACCES: %s\n", strerror(EACCES));
errno = ENOENT;
perror(argv[0]);
exit(0);
}
all: mycat hello testerror
mycat: ls1.c
g++ -g -Wall ls1.c ../lib/libapue.a -I ../include -o ls1
hello: hello.c
g++ -g -Wall hello.c -I ../include/ ../lib/libapue.a -o hello
testerror: testerror.c
g++ -g -Wall testerror.c -I ../include/ ../lib/libapue.a -o testerror
clean:
rm ls1 hello testerror
转载于:https://www.cnblogs.com/sunyongjie1984/p/4260720.html
相关资源:UNIX环境高级编程和源代码