1 #include "apue.h" 2 #include <fcntl.h> 3 4 #define RWRWRW (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) 5 6 int main(int argc,char *argv[]) 7 { 8 umask(0); 9 if(creat("zbzhuang",RWRWRW) < 0) 10 err_sys("create error for zbzhuang "); 11 12 umask(S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); 13 if(creat("caylin",RWRWRW) < 0) 14 err_sys("create error for caylin "); 15 16 return 0; 17 } 18 ~