Bug #756

select(2): a minor man patch and a question

Added by nthery over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:
Priority:LowDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Hello,

DragonFly BSD has <sys/select.h> but "man select" specifies an older
synopsis. Here is a
patch to change this.

Index: src/lib/libc/sys/select.2
===================================================================
--- src.orig/lib/libc/sys/select.2 2006-05-26 21:39:37.000000000 +0200
+++ src/lib/libc/sys/select.2 2007-08-01 09:03:54.000000000 +0200
@@ -42,9 +42,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In sys/types.h
-.In sys/time.h
-.In unistd.h
+.In sys/select.h
.Ft int
.Fn select "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set
*exceptfds" "struct timeval *timeout"
.Fn FD_SET fd &fdset

On a related note, a warning is issued when compiling a program that
uses FD_ZERO() because
bzero() is used under the hood and its prototype is not found.

I'm not sure what is the Right Thing to do:

1) Leave the warning. It is up to client code to include <string.h>
first (but this is not
specified in http://www.opengroup.org/onlinepubs/009695399/functions/select.html)

2) #include <string.h> in <sys/select.h> when building userland code.

3) copy bzero() prototype into <sys/select.h>

Thanks in advance,
Nicolas

History

#1 Updated by joerg over 6 years ago

It must use memset and it most likely should declare a prototype for it.

Joerg

#2 Updated by swildner over 6 years ago

Thanks, committed.

Sascha

#3 Updated by joerg over 6 years ago

It should be noted that some DragonFly versions did *not* allow
including sys/select.h. Including unistd.h is relative portable and
works on most systems, sys/select.h is not present everywhere.

Joerg

Also available in: Atom PDF