#include #include #include #include #include int main(int argc, char **argv) { umask(0); if ( creat("foo", S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) == -1 ) { perror("create error for foo"); exit(1); } umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if ( creat("bar", S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) == -1 ) { perror("create error for bar"); exit(1); } return 0; }