Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

documentation/3382: select(2) does not mention needed #include <string.h>

From: <cjeker(at)diehard.n-r-g.com>
Date: Wed Jul 30 2003 - 08:28:16 EDT


>Number: 3382
>Category: documentation
>Synopsis: FD_ZERO needs #include <string.h> which is not mentioned in select(2)
>Confidential: yes
>Severity: non-critical
>Priority: low
>Responsible: bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Wed Jul 30 12:40:01 GMT 2003
>Closed-Date:
>Last-Modified:
>Originator: Claudio Jeker
>Release: -current
>Organization:
>Environment:
        

	System      : OpenBSD 3.3
	Architecture: OpenBSD.i386
	Machine     : i386

>Description:
        

The man page of select(2) lists sys/types.h, sys/time.h and unistd.h as needed include files. FD_ZERO and FD_COPY use the functions memset and memcpy which are defined in string.h.
>How-To-Repeat:
        

compile this program:

#include 
#include 
#include 

int main(int argc, char **argv)
{

        fd_set testfd;

        FD_ZERO(&testfd);
}

> cc test.c

test.c: In function `main':
test.c:9: warning: type mismatch in implicit declaration for built-in function `memset'
>Fix:
        

Following patch should do the trick:
diff -u -u -r1.21 select.2
--- select.2 19 Nov 2002 20:57:13 -0000 1.21 +++ select.2 30 Jul 2003 12:19:03 -0000 @@ -43,6 +43,7 @@

 .Sh SYNOPSIS
 .Fd #include 
 .Fd #include 
+.Fd #include 
 .Fd #include 
 .Ft int
 .Fn select "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set *exceptfds" "struct timeval *timeout" 
Do you need help?X

>Release-Note:
Received on Wed Jul 30 08:46:23 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:30:06 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library