On Sat, Mar 05, 2016 at 01:33:55AM +0530, Anchit Jain wrote: > 05.03.2016, 01:17, "Dmitry V. Levin" <l...@altlinux.org>: > > On Fri, Mar 04, 2016 at 07:26:35PM +0000, Anchit Jain wrote: [...] > >> + int create_file_desc = open("chmod_test_file", O_CREAT|O_RDONLY, 0400); > > > > Do you plan to use other descriptors besides this one? > > If not, "create_file_desc" is too verbose. > > Would file_desc work?
Even "fd" would be OK. > >> + perror_msg_and_fail("chmod -1"); > > > > What does this "chmod -1" mean? > > What should be the error message? Like chmod failed due to this error? Since it's "open" that failed and not "chmod", just use "open". > >> + if(syscall(__NR_chmod, "chmod_test_file", 0600) != 0) > >> + perror_msg_and_fail("chmod -1"); > > > > Let me repeat: chmod syscall can legitimately fail with ENOSYS. > > How can I check that? errno == ENOSYS? -- ldv
pgpT3vYsi6724.pgp
Description: PGP signature
------------------------------------------------------------------------------
_______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel