develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH] perlfunc return-value addition for chroot(), etc.

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
July 30, 2001 17:21
Subject:
Re: [PATCH] perlfunc return-value addition for chroot(), etc.
Message ID:
20010730192028.G1239@chaos.wustl.edu
On Sun, Jul 29, 2001 at 10:16:53PM -0700, Jeffrey Friedl wrote:
> 
> My brother was confused due to chroot()'s return status being opposite
> of the system call's, so I added
> 
>   Returns true upon success, otherwise returns false and sets C<$!> (errno).
> 
> to the doc. A quick scan of the code showed two other similar situations.
> Patch appended.
>         Jeffrey

Ummm, I'm not so certain about this patch.  Yes, it's _correct_,
but isn't the behaviour

 Returns true upon success, otherwise returns false and sets C<$!> (errno).

pretty much comprehensive over almost all system calls (e.g. mkdir,
flock, chdir, opendir, ...)?

(In the past there has been discussion about the general problem, that the
 perlfunc descriptions document their return values in a somewhat haphazard
 fashion, there is no consistency or common format to adhere to.)

> --- .orig/pod/perlfunc.pod	Tue Jul 17 02:08:25 2001
> +++ pod/perlfunc.pod	Sun Jul 29 22:14:58 2001
> @@ -702,4 +702,5 @@
>  reasons, this call is restricted to the superuser.  If FILENAME is
>  omitted, does a C<chroot> to C<$_>.
> +Returns true upon success, otherwise returns false and sets C<$!> (errno).
>  
>  =item close FILEHANDLE
> @@ -4103,4 +4104,5 @@
>  accept any arguments, so only C<setpgrp(0,0)> is portable.  See also
>  C<POSIX::setsid()>.
> +Returns true upon success, otherwise returns false and sets C<$!> (errno).
>  
>  =item setpriority WHICH,WHO,PRIORITY
> @@ -4109,4 +4111,5 @@
>  (See setpriority(2).)  Will produce a fatal error if used on a machine
>  that doesn't implement setpriority(2).
> +Returns true upon success, otherwise returns false and sets C<$!> (errno).
>  
>  =item setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About