Question about man 2 fcntl

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about man 2 fcntl

Masato Asou
The following statement is a part of man 2 fctl.

     [EINTR]            The argument cmd is invalid.

                        The argument cmd is F_SETLKW, and the function
                        was
                        interrupted by a signal.

Will EINVAL be returned in the case of 'The argument cmd is invalid'?

Will EINTR be returned for F_SETLK?
The following code is sys/kern/kern_descrip.c sys_fcntl():

        case F_SETLKW:
                flg |= F_WAIT;
                /* FALLTHROUGH */

        case F_SETLK:

How about it?

Index: fcntl.2
===================================================================
RCS file: /cvs/src/lib/libc/sys/fcntl.2,v
retrieving revision 1.32
diff -u -p -r1.32 fcntl.2
--- fcntl.2 10 Nov 2018 11:54:03 -0000 1.32
+++ fcntl.2 4 Sep 2019 07:15:33 -0000
@@ -465,14 +465,14 @@ and a deadlock condition was detected.
 .It Bq Er EINTR
 The argument
 .Fa cmd
-is invalid.
-.Pp
-The argument
-.Fa cmd
 is
-.Dv F_SETLKW ,
+.Dv F_SETLK or F_SETLKW ,
 and the function was interrupted by a signal.
 .It Bq Er EINVAL
+The argument
+.Fa cmd
+is invalid.
+.Pp
 .Fa cmd
 is
 .Dv F_DUPFD
--
ASOU Masato

Reply | Threaded
Open this post in threaded view
|

Re: Question about man 2 fcntl

Theo de Raadt-2
This looks like a mis-merge in revision 1.30 of fcntl.2

The chunk was added in the wrong place, and I can see why.  A sentence
component was accidentally deleted.  Your diff looked funny, so I redid
it and came to the same conclusion.

ok deraadt


Masato Asou <[hidden email]> wrote:

> The following statement is a part of man 2 fctl.
>
>      [EINTR]            The argument cmd is invalid.
>
>                         The argument cmd is F_SETLKW, and the function
>                         was
>                         interrupted by a signal.
>
> Will EINVAL be returned in the case of 'The argument cmd is invalid'?
>
> Will EINTR be returned for F_SETLK?
> The following code is sys/kern/kern_descrip.c sys_fcntl():
>
>         case F_SETLKW:
>                 flg |= F_WAIT;
>                 /* FALLTHROUGH */
>
>         case F_SETLK:
>
> How about it?
>
> Index: fcntl.2
> ===================================================================
> RCS file: /cvs/src/lib/libc/sys/fcntl.2,v
> retrieving revision 1.32
> diff -u -p -r1.32 fcntl.2
> --- fcntl.2 10 Nov 2018 11:54:03 -0000 1.32
> +++ fcntl.2 4 Sep 2019 07:15:33 -0000
> @@ -465,14 +465,14 @@ and a deadlock condition was detected.
>  .It Bq Er EINTR
>  The argument
>  .Fa cmd
> -is invalid.
> -.Pp
> -The argument
> -.Fa cmd
>  is
> -.Dv F_SETLKW ,
> +.Dv F_SETLK or F_SETLKW ,
>  and the function was interrupted by a signal.
>  .It Bq Er EINVAL
> +The argument
> +.Fa cmd
> +is invalid.
> +.Pp
>  .Fa cmd
>  is
>  .Dv F_DUPFD
> --
> ASOU Masato
>

Reply | Threaded
Open this post in threaded view
|

Re: Question about man 2 fcntl

Theo Buehler-3
In reply to this post by Masato Asou
> +.Dv F_SETLK or F_SETLKW ,

should be split into

        .Dv F_SETLK
        or
        .Dv F_SETLKW ,

and with that this diff is

ok tb