[PATCH] tests: add chmod.test

Anchit Jain mailinglist at anchitja.in
Fri Mar 4 20:18:33 UTC 2016



05.03.2016, 01:39, "Dmitry V. Levin" <ldv at altlinux.org>:
> On Sat, Mar 05, 2016 at 01:33:55AM +0530, Anchit Jain wrote:
>>  05.03.2016, 01:17, "Dmitry V. Levin" <ldv at 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?

So in case if errno is ENOSYS test should be skipped rather than failing ?

>
> --
> ldv
> ,
>
> ------------------------------------------------------------------------------
> ,
>
> _______________________________________________
> Strace-devel mailing list
> Strace-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel

-- 
Sincerely, Anchit Jain
mailinglist at anchitja.in




More information about the Strace-devel mailing list