ia64/xen-unstable

changeset 18510:7424f989fe01

mini-os: adding some missing posix function declarations

Adding some missing posix function declarations, to get rid of some
qemu-remote compile time warnings.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Sep 17 13:10:36 2008 +0100 (2008-09-17)
parents 9ab9dadf4876
children beb28a3975bd
files extras/mini-os/include/posix/arpa/inet.h extras/mini-os/include/posix/signal.h extras/mini-os/include/posix/sys/poll.h extras/mini-os/include/posix/time.h extras/mini-os/include/posix/unistd.h extras/mini-os/include/x86/os.h extras/mini-os/lib/sys.c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/extras/mini-os/include/posix/arpa/inet.h	Wed Sep 17 13:10:36 2008 +0100
     1.3 @@ -0,0 +1,7 @@
     1.4 +#ifndef _POSIX_ARPA_INET_H_
     1.5 +#define	_POSIX_ARPA_INET_H_
     1.6 +
     1.7 +#include <lwip/inet.h>
     1.8 +
     1.9 +#endif /* _POSIX_ARPA_INET_H_ */
    1.10 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/extras/mini-os/include/posix/signal.h	Wed Sep 17 13:10:36 2008 +0100
     2.3 @@ -0,0 +1,10 @@
     2.4 +#ifndef _POSIX_SIGNAL_H
     2.5 +#define _POSIX_SIGNAL_H
     2.6 +
     2.7 +#include_next <signal.h>
     2.8 +
     2.9 +int sigaction(int signum, const struct sigaction * __restrict,
    2.10 +              struct sigaction * __restrict);
    2.11 +
    2.12 +#endif
    2.13 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/extras/mini-os/include/posix/sys/poll.h	Wed Sep 17 13:10:36 2008 +0100
     3.3 @@ -0,0 +1,79 @@
     3.4 +/*
     3.5 + * This code is mostly taken from FreeBSD sys/sys/poll.h 
     3.6 + * Changes: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
     3.7 + *
     3.8 + ****************************************************************************
     3.9 + * Copyright (c) 1997 Peter Wemm <peter@freebsd.org>
    3.10 + * All rights reserved.
    3.11 + *
    3.12 + * Redistribution and use in source and binary forms, with or without
    3.13 + * modification, are permitted provided that the following conditions
    3.14 + * are met:
    3.15 + * 1. Redistributions of source code must retain the above copyright
    3.16 + *    notice, this list of conditions and the following disclaimer.
    3.17 + * 2. Redistributions in binary form must reproduce the above copyright
    3.18 + *    notice, this list of conditions and the following disclaimer in the
    3.19 + *    documentation and/or other materials provided with the distribution.
    3.20 + * 3. The name of the author may not be used to endorse or promote products
    3.21 + *    derived from this software without specific prior written permission.
    3.22 + *
    3.23 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    3.24 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    3.25 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    3.26 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    3.27 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    3.28 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    3.29 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    3.30 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    3.31 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    3.32 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    3.33 + * SUCH DAMAGE.
    3.34 + */
    3.35 +
    3.36 +#ifndef _POSIX_SYS_POLL_H_
    3.37 +#define	_POSIX_SYS_POLL_H_
    3.38 +
    3.39 +/*
    3.40 + * This file is intended to be compatible with the traditional poll.h.
    3.41 + */
    3.42 +
    3.43 +typedef	unsigned int	nfds_t;
    3.44 +
    3.45 +/*
    3.46 + * This structure is passed as an array to poll(2).
    3.47 + */
    3.48 +struct pollfd {
    3.49 +	int	fd;		/* which file descriptor to poll */
    3.50 +	short	events;		/* events we are interested in */
    3.51 +	short	revents;	/* events found on return */
    3.52 +};
    3.53 +
    3.54 +/*
    3.55 + * Requestable events.  If poll(2) finds any of these set, they are
    3.56 + * copied to revents on return.
    3.57 + * XXX Note that FreeBSD doesn't make much distinction between POLLPRI
    3.58 + * and POLLRDBAND since none of the file types have distinct priority
    3.59 + * bands - and only some have an urgent "mode".
    3.60 + * XXX Note POLLIN isn't really supported in true SVSV terms.  Under SYSV
    3.61 + * POLLIN includes all of normal, band and urgent data.  Most poll handlers
    3.62 + * on FreeBSD only treat it as "normal" data.
    3.63 + */
    3.64 +#define	POLLIN		0x0001		/* any readable data available */
    3.65 +#define	POLLPRI		0x0002		/* OOB/Urgent readable data */
    3.66 +#define	POLLOUT		0x0004		/* file descriptor is writeable */
    3.67 +#define	POLLRDNORM	0x0040		/* non-OOB/URG data available */
    3.68 +#define	POLLWRNORM	POLLOUT		/* no write type differentiation */
    3.69 +#define	POLLRDBAND	0x0080		/* OOB/Urgent readable data */
    3.70 +#define	POLLWRBAND	0x0100		/* OOB/Urgent data can be written */
    3.71 +
    3.72 +/*
    3.73 + * These events are set if they occur regardless of whether they were
    3.74 + * requested.
    3.75 + */
    3.76 +#define	POLLERR		0x0008		/* some poll error occurred */
    3.77 +#define	POLLHUP		0x0010		/* file descriptor was "hung up" */
    3.78 +#define	POLLNVAL	0x0020		/* requested events "invalid" */
    3.79 +
    3.80 +int	poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
    3.81 +
    3.82 +#endif /* _POSIX_SYS_POLL_H_ */
     4.1 --- a/extras/mini-os/include/posix/time.h	Tue Sep 16 15:57:22 2008 +0100
     4.2 +++ b/extras/mini-os/include/posix/time.h	Wed Sep 17 13:10:36 2008 +0100
     4.3 @@ -6,5 +6,6 @@
     4.4  #include_next <time.h>
     4.5  
     4.6  int nanosleep(const struct timespec *req, struct timespec *rem);
     4.7 +int clock_gettime(clockid_t clock_id, struct timespec *tp);
     4.8  
     4.9  #endif /* _POSIX_TIME_H */
     5.1 --- a/extras/mini-os/include/posix/unistd.h	Tue Sep 16 15:57:22 2008 +0100
     5.2 +++ b/extras/mini-os/include/posix/unistd.h	Wed Sep 17 13:10:36 2008 +0100
     5.3 @@ -5,5 +5,6 @@
     5.4  
     5.5  size_t getpagesize(void);
     5.6  int ftruncate(int fd, off_t length);
     5.7 +int lockf(int fd, int cmd, off_t len);
     5.8  
     5.9  #endif /* _POSIX_UNISTD_H */
     6.1 --- a/extras/mini-os/include/x86/os.h	Tue Sep 16 15:57:22 2008 +0100
     6.2 +++ b/extras/mini-os/include/x86/os.h	Wed Sep 17 13:10:36 2008 +0100
     6.3 @@ -11,6 +11,7 @@
     6.4  #define __builtin_expect(x, expected_value) (x)
     6.5  #endif
     6.6  #define unlikely(x)  __builtin_expect((x),0)
     6.7 +#define likely(x)  __builtin_expect((x),1)
     6.8  
     6.9  #define smp_processor_id() 0
    6.10  
     7.1 --- a/extras/mini-os/lib/sys.c	Tue Sep 16 15:57:22 2008 +0100
     7.2 +++ b/extras/mini-os/lib/sys.c	Wed Sep 17 13:10:36 2008 +0100
     7.3 @@ -1322,6 +1322,7 @@ unsupported_function_crash(lockf);
     7.4  unsupported_function_crash(sysconf);
     7.5  unsupported_function(int, tcsetattr, -1);
     7.6  unsupported_function(int, tcgetattr, 0);
     7.7 +unsupported_function(int, poll, -1);
     7.8  
     7.9  /* Linuxish abi for the Caml runtime, don't support */
    7.10  unsupported_function_log(struct dirent *, readdir64, NULL);