mirror of
https://github.com/drasko/codezero.git
synced 2026-02-28 17:53:13 +01:00
Initial commit
This commit is contained in:
3
tasks/libposix/include/posix/sys/bitypes.h
Normal file
3
tasks/libposix/include/posix/sys/bitypes.h
Normal file
@@ -0,0 +1,3 @@
|
||||
/* The GNU <sys/types.h> defines all the necessary types. */
|
||||
|
||||
#include <sys/types.h>
|
||||
320
tasks/libposix/include/posix/sys/cdefs.h
Normal file
320
tasks/libposix/include/posix/sys/cdefs.h
Normal file
@@ -0,0 +1,320 @@
|
||||
/* Copyright (C) 1992-2001, 2002, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_CDEFS_H
|
||||
#define _SYS_CDEFS_H 1
|
||||
|
||||
/* We are almost always included from features.h. */
|
||||
#ifndef _FEATURES_H
|
||||
# include <features.h>
|
||||
#endif
|
||||
|
||||
/* The GNU libc does not support any K&R compilers or the traditional mode
|
||||
of ISO C compilers anymore. Check for some of the combinations not
|
||||
anymore supported. */
|
||||
#if defined __GNUC__ && !defined __STDC__
|
||||
# error "You need a ISO C conforming compiler to use the glibc headers"
|
||||
#endif
|
||||
|
||||
/* Some user header file might have defined this before. */
|
||||
#undef __P
|
||||
#undef __PMT
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
/* GCC can always grok prototypes. For C++ programs we add throw()
|
||||
to help it optimize the function calls. But this works only with
|
||||
gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
|
||||
as non-throwing using a function attribute since programs can use
|
||||
the -fexceptions options for C code as well. */
|
||||
# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
|
||||
# define __THROW __attribute__ ((__nothrow__))
|
||||
# define __NTH(fct) __attribute__ ((__nothrow__)) fct
|
||||
# else
|
||||
# if defined __cplusplus && __GNUC_PREREQ (2,8)
|
||||
# define __THROW throw ()
|
||||
# define __NTH(fct) fct throw ()
|
||||
# else
|
||||
# define __THROW
|
||||
# define __NTH(fct) fct
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#else /* Not GCC. */
|
||||
|
||||
# define __inline /* No inline functions. */
|
||||
|
||||
# define __THROW
|
||||
# define __NTH(fct) fct
|
||||
|
||||
# define __const const
|
||||
# define __signed signed
|
||||
# define __volatile volatile
|
||||
|
||||
#endif /* GCC. */
|
||||
|
||||
/* These two macros are not used in glibc anymore. They are kept here
|
||||
only because some other projects expect the macros to be defined. */
|
||||
#define __P(args) args
|
||||
#define __PMT(args) args
|
||||
|
||||
/* For these things, GCC behaves the ANSI way normally,
|
||||
and the non-ANSI way under -traditional. */
|
||||
|
||||
#define __CONCAT(x,y) x ## y
|
||||
#define __STRING(x) #x
|
||||
|
||||
/* This is not a typedef so `const __ptr_t' does the right thing. */
|
||||
#define __ptr_t void *
|
||||
#define __long_double_t long double
|
||||
|
||||
|
||||
/* C++ needs to know that types and declarations are C, not C++. */
|
||||
#ifdef __cplusplus
|
||||
# define __BEGIN_DECLS extern "C" {
|
||||
# define __END_DECLS }
|
||||
#else
|
||||
# define __BEGIN_DECLS
|
||||
# define __END_DECLS
|
||||
#endif
|
||||
|
||||
|
||||
/* The standard library needs the functions from the ISO C90 standard
|
||||
in the std namespace. At the same time we want to be safe for
|
||||
future changes and we include the ISO C99 code in the non-standard
|
||||
namespace __c99. The C++ wrapper header take case of adding the
|
||||
definitions to the global namespace. */
|
||||
#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES
|
||||
# define __BEGIN_NAMESPACE_STD namespace std {
|
||||
# define __END_NAMESPACE_STD }
|
||||
# define __USING_NAMESPACE_STD(name) using std::name;
|
||||
# define __BEGIN_NAMESPACE_C99 namespace __c99 {
|
||||
# define __END_NAMESPACE_C99 }
|
||||
# define __USING_NAMESPACE_C99(name) using __c99::name;
|
||||
#else
|
||||
/* For compatibility we do not add the declarations into any
|
||||
namespace. They will end up in the global namespace which is what
|
||||
old code expects. */
|
||||
# define __BEGIN_NAMESPACE_STD
|
||||
# define __END_NAMESPACE_STD
|
||||
# define __USING_NAMESPACE_STD(name)
|
||||
# define __BEGIN_NAMESPACE_C99
|
||||
# define __END_NAMESPACE_C99
|
||||
# define __USING_NAMESPACE_C99(name)
|
||||
#endif
|
||||
|
||||
|
||||
/* Support for bounded pointers. */
|
||||
#ifndef __BOUNDED_POINTERS__
|
||||
# define __bounded /* nothing */
|
||||
# define __unbounded /* nothing */
|
||||
# define __ptrvalue /* nothing */
|
||||
#endif
|
||||
|
||||
|
||||
/* Fortify support. */
|
||||
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
|
||||
#define __bos0(ptr) __builtin_object_size (ptr, 0)
|
||||
#define __warndecl(name, msg) extern void name (void)
|
||||
|
||||
|
||||
/* Support for flexible arrays. */
|
||||
#if __GNUC_PREREQ (2,97)
|
||||
/* GCC 2.97 supports C99 flexible array members. */
|
||||
# define __flexarr []
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# define __flexarr [0]
|
||||
# else
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
# define __flexarr []
|
||||
# else
|
||||
/* Some other non-C99 compiler. Approximate with [1]. */
|
||||
# define __flexarr [1]
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* __asm__ ("xyz") is used throughout the headers to rename functions
|
||||
at the assembly language level. This is wrapped by the __REDIRECT
|
||||
macro, in order to support compilers that can do this some other
|
||||
way. When compilers don't support asm-names at all, we have to do
|
||||
preprocessor tricks instead (which don't have exactly the right
|
||||
semantics, but it's the best we can do).
|
||||
|
||||
Example:
|
||||
int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
|
||||
# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
|
||||
# ifdef __cplusplus
|
||||
# define __REDIRECT_NTH(name, proto, alias) \
|
||||
name proto __THROW __asm__ (__ASMNAME (#alias))
|
||||
# else
|
||||
# define __REDIRECT_NTH(name, proto, alias) \
|
||||
name proto __asm__ (__ASMNAME (#alias)) __THROW
|
||||
# endif
|
||||
# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
|
||||
# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
|
||||
|
||||
/*
|
||||
#elif __SOME_OTHER_COMPILER__
|
||||
|
||||
# define __REDIRECT(name, proto, alias) name proto; \
|
||||
_Pragma("let " #name " = " #alias)
|
||||
*/
|
||||
#endif
|
||||
|
||||
/* GCC has various useful declarations that can be made with the
|
||||
`__attribute__' syntax. All of the ways we use this do fine if
|
||||
they are omitted for compilers that don't understand it. */
|
||||
#if !defined __GNUC__ || __GNUC__ < 2
|
||||
# define __attribute__(xyz) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* We make this a no-op unless it can be used as both a variable and
|
||||
a type attribute. gcc 2.8 is known to support both. */
|
||||
#if __GNUC_PREREQ (2,8)
|
||||
# define __attribute_aligned__(size) __attribute__ ((__aligned__ (size)))
|
||||
#else
|
||||
# define __attribute_aligned__(size) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.96 development the `malloc' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (2,96)
|
||||
# define __attribute_malloc__ __attribute__ ((__malloc__))
|
||||
#else
|
||||
# define __attribute_malloc__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.96 development the `pure' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (2,96)
|
||||
# define __attribute_pure__ __attribute__ ((__pure__))
|
||||
#else
|
||||
# define __attribute_pure__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 3.1 development the `used' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (3,1)
|
||||
# define __attribute_used__ __attribute__ ((__used__))
|
||||
# define __attribute_noinline__ __attribute__ ((__noinline__))
|
||||
#else
|
||||
# define __attribute_used__ __attribute__ ((__unused__))
|
||||
# define __attribute_noinline__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* gcc allows marking deprecated functions. */
|
||||
#if __GNUC_PREREQ (3,2) && !defined(__UCLIBC_HIDE_DEPRECATED__)
|
||||
# define __attribute_deprecated__ __attribute__ ((__deprecated__))
|
||||
#else
|
||||
# define __attribute_deprecated__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.8 development the `format_arg' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings.
|
||||
If several `format_arg' attributes are given for the same function, in
|
||||
gcc-3.0 and older, all but the last one are ignored. In newer gccs,
|
||||
all designated arguments are considered. */
|
||||
#if __GNUC_PREREQ (2,8)
|
||||
# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
|
||||
#else
|
||||
# define __attribute_format_arg__(x) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.97 development the `strfmon' format
|
||||
attribute for functions was introduced. We don't want to use it
|
||||
unconditionally (although this would be possible) since it
|
||||
generates warnings. */
|
||||
#if __GNUC_PREREQ (2,97)
|
||||
# define __attribute_format_strfmon__(a,b) \
|
||||
__attribute__ ((__format__ (__strfmon__, a, b)))
|
||||
#else
|
||||
# define __attribute_format_strfmon__(a,b) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* The nonull function attribute allows to mark pointer parameters which
|
||||
must not be NULL. */
|
||||
#if __GNUC_PREREQ (3,3)
|
||||
# define __nonnull(params) __attribute__ ((__nonnull__ params))
|
||||
#else
|
||||
# define __nonnull(params)
|
||||
#endif
|
||||
|
||||
/* If fortification mode, we warn about unused results of certain
|
||||
function calls which can lead to problems. */
|
||||
#if __GNUC_PREREQ (3,4)
|
||||
# define __attribute_warn_unused_result__ \
|
||||
__attribute__ ((__warn_unused_result__))
|
||||
# if __USE_FORTIFY_LEVEL > 0
|
||||
# define __wur __attribute_warn_unused_result__
|
||||
# endif
|
||||
#else
|
||||
# define __attribute_warn_unused_result__ /* empty */
|
||||
#endif
|
||||
#ifndef __wur
|
||||
# define __wur /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Forces a function to be always inlined. */
|
||||
#if __GNUC_PREREQ (3,2)
|
||||
# define __always_inline __inline __attribute__ ((__always_inline__))
|
||||
#else
|
||||
# define __always_inline __inline
|
||||
#endif
|
||||
|
||||
/* It is possible to compile containing GCC extensions even if GCC is
|
||||
run in pedantic mode if the uses are carefully marked using the
|
||||
`__extension__' keyword. But this is not generally available before
|
||||
version 2.8. */
|
||||
#if !__GNUC_PREREQ (2,8)
|
||||
# define __extension__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* __restrict is known in EGCS 1.2 and above. */
|
||||
#if !__GNUC_PREREQ (2,92)
|
||||
# define __restrict /* Ignore */
|
||||
#endif
|
||||
|
||||
/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
|
||||
array_name[restrict]
|
||||
GCC 3.1 supports this. */
|
||||
#if __GNUC_PREREQ (3,1) && !defined __GNUG__
|
||||
# define __restrict_arr __restrict
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# define __restrict_arr /* Not supported in old GCC. */
|
||||
# else
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
# define __restrict_arr restrict
|
||||
# else
|
||||
/* Some other non-C99 compiler. */
|
||||
# define __restrict_arr /* Not supported. */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* sys/cdefs.h */
|
||||
28
tasks/libposix/include/posix/sys/dir.h
Normal file
28
tasks/libposix/include/posix/sys/dir.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_DIR_H
|
||||
#define _SYS_DIR_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#define direct dirent
|
||||
|
||||
#endif /* sys/dir.h */
|
||||
1
tasks/libposix/include/posix/sys/errno.h
Normal file
1
tasks/libposix/include/posix/sys/errno.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <errno.h>
|
||||
1
tasks/libposix/include/posix/sys/fcntl.h
Normal file
1
tasks/libposix/include/posix/sys/fcntl.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <fcntl.h>
|
||||
56
tasks/libposix/include/posix/sys/file.h
Normal file
56
tasks/libposix/include/posix/sys/file.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* Copyright (C) 1991, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_FILE_H
|
||||
#define _SYS_FILE_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
|
||||
/* Alternate names for values for the WHENCE argument to `lseek'.
|
||||
These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
|
||||
#ifndef L_SET
|
||||
# define L_SET 0 /* Seek from beginning of file. */
|
||||
# define L_INCR 1 /* Seek from current position. */
|
||||
# define L_XTND 2 /* Seek from end of file. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Operations for the `flock' call. */
|
||||
#define LOCK_SH 1 /* Shared lock. */
|
||||
#define LOCK_EX 2 /* Exclusive lock. */
|
||||
#define LOCK_UN 8 /* Unlock. */
|
||||
|
||||
/* Can be OR'd in to one of the above. */
|
||||
#define LOCK_NB 4 /* Don't block when locking. */
|
||||
|
||||
|
||||
/* Apply or remove an advisory lock, according to OPERATION,
|
||||
on the file FD refers to. */
|
||||
extern int flock (int __fd, int __operation) __THROW;
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/file.h */
|
||||
36
tasks/libposix/include/posix/sys/fsuid.h
Normal file
36
tasks/libposix/include/posix/sys/fsuid.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_FSUID_H
|
||||
#define _SYS_FSUID_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Change uid used for file access control to UID, without affecting
|
||||
other privileges (such as who can send signals at the process). */
|
||||
extern int setfsuid (__uid_t __uid) __THROW;
|
||||
|
||||
/* Ditto for group id. */
|
||||
extern int setfsgid (__gid_t __gid) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* fsuid.h */
|
||||
46
tasks/libposix/include/posix/sys/ioctl.h
Normal file
46
tasks/libposix/include/posix/sys/ioctl.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 96, 98, 99 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_IOCTL_H
|
||||
#define _SYS_IOCTL_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Get the list of `ioctl' requests and related constants. */
|
||||
#include <bits/ioctls.h>
|
||||
|
||||
/* Define some types used by `ioctl' requests. */
|
||||
#include <bits/ioctl-types.h>
|
||||
|
||||
/* On a Unix system, the system <sys/ioctl.h> probably defines some of
|
||||
the symbols we define in <sys/ttydefaults.h> (usually with the same
|
||||
values). The code to generate <bits/ioctls.h> has omitted these
|
||||
symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h>
|
||||
to define them, so we must include <sys/ttydefaults.h> here. */
|
||||
#include <sys/ttydefaults.h>
|
||||
|
||||
/* Perform the I/O control operation specified by REQUEST on FD.
|
||||
One argument may follow; its presence and type depend on REQUEST.
|
||||
Return value depends on REQUEST. Usually -1 indicates error. */
|
||||
extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ioctl.h */
|
||||
58
tasks/libposix/include/posix/sys/ipc.h
Normal file
58
tasks/libposix/include/posix/sys/ipc.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/* Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_IPC_H
|
||||
#define _SYS_IPC_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#if !defined __USE_SVID && !defined __USE_XOPEN && __GNUC__ >= 2
|
||||
# warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
|
||||
#endif
|
||||
|
||||
/* Get system dependent definition of `struct ipc_perm' and more. */
|
||||
#include <bits/ipc.h>
|
||||
|
||||
#ifndef __uid_t_defined
|
||||
typedef __uid_t uid_t;
|
||||
# define __uid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __gid_t_defined
|
||||
typedef __gid_t gid_t;
|
||||
# define __gid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __mode_t_defined
|
||||
typedef __mode_t mode_t;
|
||||
# define __mode_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __key_t_defined
|
||||
typedef __key_t key_t;
|
||||
# define __key_t_defined
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Generates key for System V style IPC. */
|
||||
extern key_t ftok (__const char *__pathname, int __proj_id) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ipc.h */
|
||||
35
tasks/libposix/include/posix/sys/kd.h
Normal file
35
tasks/libposix/include/posix/sys/kd.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_KD_H
|
||||
#define _SYS_KD_H 1
|
||||
|
||||
/* Make sure the <linux/types.h> header is not loaded. */
|
||||
#ifndef _LINUX_TYPES_H
|
||||
# define _LINUX_TYPES_H 1
|
||||
# define __undef_LINUX_TYPES_H
|
||||
#endif
|
||||
|
||||
#include <linux/kd.h>
|
||||
|
||||
#ifdef __undef_LINUX_TYPES_H
|
||||
# undef _LINUX_TYPES_H
|
||||
# undef __undef_LINUX_TYPES_H
|
||||
#endif
|
||||
|
||||
#endif /* sys/kd.h */
|
||||
33
tasks/libposix/include/posix/sys/kdaemon.h
Normal file
33
tasks/libposix/include/posix/sys/kdaemon.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Copyright (C) 1996, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* Interfaces to control the various kernel daemons. */
|
||||
|
||||
#ifndef _SYS_KDAEMON_H
|
||||
|
||||
#define _SYS_KDAEMON_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Start, flush, or tune the kernel's buffer flushing daemon. */
|
||||
extern int bdflush (int __func, long int __data) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_KDAEMON_H */
|
||||
34
tasks/libposix/include/posix/sys/klog.h
Normal file
34
tasks/libposix/include/posix/sys/klog.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* Copyright (C) 1996, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_KLOG_H
|
||||
|
||||
#define _SYS_KLOG_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Control the kernel's logging facility. This corresponds exactly to
|
||||
the kernel's syslog system call, but that name is easily confused
|
||||
with the user-level syslog facility, which is something completely
|
||||
different. */
|
||||
extern int klogctl (int __type, char *__bufp, int __len) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_KLOG_H */
|
||||
174
tasks/libposix/include/posix/sys/mman.h
Normal file
174
tasks/libposix/include/posix/sys/mman.h
Normal file
@@ -0,0 +1,174 @@
|
||||
/* Definitions for BSD-style memory management.
|
||||
Copyright (C) 1994-2000, 2003, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_MMAN_H
|
||||
#define _SYS_MMAN_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <bits/types.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef __off_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __off_t off_t;
|
||||
# else
|
||||
typedef __off64_t off_t;
|
||||
# endif
|
||||
# define __off_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __mode_t_defined
|
||||
typedef __mode_t mode_t;
|
||||
# define __mode_t_defined
|
||||
#endif
|
||||
|
||||
#include <bits/mman.h>
|
||||
|
||||
/* Return value of `mmap' in case of an error. */
|
||||
#define MAP_FAILED ((void *) -1)
|
||||
|
||||
__BEGIN_DECLS
|
||||
/* Map addresses starting near ADDR and extending for LEN bytes. from
|
||||
OFFSET into the file FD describes according to PROT and FLAGS. If ADDR
|
||||
is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
|
||||
set in FLAGS, the mapping will be at ADDR exactly (which must be
|
||||
page-aligned); otherwise the system chooses a convenient nearby address.
|
||||
The return value is the actual mapping address chosen or MAP_FAILED
|
||||
for errors (in which case `errno' is set). A successful `mmap' call
|
||||
deallocates any previous mapping for the affected region. */
|
||||
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern void *mmap (void *__addr, size_t __len, int __prot,
|
||||
int __flags, int __fd, __off_t __offset) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern void * __REDIRECT (mmap,
|
||||
(void *__addr, size_t __len, int __prot,
|
||||
int __flags, int __fd, __off64_t __offset),
|
||||
mmap64);
|
||||
# else
|
||||
# define mmap mmap64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern void *mmap64 (void *__addr, size_t __len, int __prot,
|
||||
int __flags, int __fd, __off64_t __offset) __THROW;
|
||||
#endif
|
||||
|
||||
/* Deallocate any mapping for the region starting at ADDR and extending LEN
|
||||
bytes. Returns 0 if successful, -1 for errors (and sets errno). */
|
||||
extern int munmap (void *__addr, size_t __len) __THROW;
|
||||
|
||||
/* Change the memory protection of the region starting at ADDR and
|
||||
extending LEN bytes to PROT. Returns 0 if successful, -1 for errors
|
||||
(and sets errno). */
|
||||
extern int mprotect (void *__addr, size_t __len, int __prot) __THROW;
|
||||
|
||||
#ifdef __ARCH_USE_MMU__
|
||||
|
||||
/* Synchronize the region starting at ADDR and extending LEN bytes with the
|
||||
file it maps. Filesystem operations on a file being mapped are
|
||||
unpredictable before this is done. Flags are from the MS_* set.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int msync (void *__addr, size_t __len, int __flags);
|
||||
|
||||
#else
|
||||
|
||||
/* On no-mmu systems you can't have real private mappings. */
|
||||
static inline int msync (void *__addr, size_t __len, int __flags) { return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Advise the system about particular usage patterns the program follows
|
||||
for the region starting at ADDR and extending LEN bytes. */
|
||||
extern int madvise (void *__addr, size_t __len, int __advice) __THROW;
|
||||
#endif
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* This is the POSIX name for this function. */
|
||||
extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
|
||||
#endif
|
||||
|
||||
#ifdef __ARCH_USE_MMU__
|
||||
|
||||
/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
|
||||
be memory resident. */
|
||||
extern int mlock (__const void *__addr, size_t __len) __THROW;
|
||||
|
||||
/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */
|
||||
extern int munlock (__const void *__addr, size_t __len) __THROW;
|
||||
|
||||
/* Cause all currently mapped pages of the process to be memory resident
|
||||
until unlocked by a call to the `munlockall', until the process exits,
|
||||
or until the process calls `execve'. */
|
||||
extern int mlockall (int __flags) __THROW;
|
||||
|
||||
/* All currently mapped pages of the process' address space become
|
||||
unlocked. */
|
||||
extern int munlockall (void) __THROW;
|
||||
|
||||
#else
|
||||
|
||||
/* On no-mmu systems, memory cannot be swapped out, so
|
||||
* these functions will always succeed. */
|
||||
static inline int mlock (__const void *__addr, size_t __len) { return 0; }
|
||||
static inline int munlock (__const void *__addr, size_t __len) { return 0; }
|
||||
static inline int mlockall (int __flags) { return 0; }
|
||||
static inline int munlockall (void) { return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length
|
||||
NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address
|
||||
may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function
|
||||
takes another paramter which is a fixed address at which the block
|
||||
resides after a successful call. */
|
||||
extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
|
||||
int __flags, ...) __THROW;
|
||||
|
||||
/* mincore returns the memory residency status of the pages in the
|
||||
current process's address space specified by [start, start + len).
|
||||
The status is returned in a vector of bytes. The least significant
|
||||
bit of each byte is 1 if the referenced page is in memory, otherwise
|
||||
it is zero. */
|
||||
extern int mincore (void *__start, size_t __len, unsigned char *__vec)
|
||||
__THROW;
|
||||
|
||||
#if 0
|
||||
/* Remap arbitrary pages of a shared backing store within an existing
|
||||
VMA. */
|
||||
extern int remap_file_pages (void *__start, size_t __size, int __prot,
|
||||
size_t __pgoff, int __flags) __THROW;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Open shared memory segment. */
|
||||
extern int shm_open (__const char *__name, int __oflag, mode_t __mode);
|
||||
|
||||
/* Remove shared memory segment. */
|
||||
extern int shm_unlink (__const char *__name);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/mman.h */
|
||||
119
tasks/libposix/include/posix/sys/mount.h
Normal file
119
tasks/libposix/include/posix/sys/mount.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/* Header file for mounting/unmount Linux filesystems.
|
||||
Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* This is taken from /usr/include/linux/fs.h. */
|
||||
|
||||
#ifndef _SYS_MOUNT_H
|
||||
#define _SYS_MOUNT_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#define BLOCK_SIZE 1024
|
||||
#define BLOCK_SIZE_BITS 10
|
||||
|
||||
|
||||
/* These are the fs-independent mount-flags: up to 16 flags are
|
||||
supported */
|
||||
enum
|
||||
{
|
||||
MS_RDONLY = 1, /* Mount read-only. */
|
||||
#define MS_RDONLY MS_RDONLY
|
||||
MS_NOSUID = 2, /* Ignore suid and sgid bits. */
|
||||
#define MS_NOSUID MS_NOSUID
|
||||
MS_NODEV = 4, /* Disallow access to device special files. */
|
||||
#define MS_NODEV MS_NODEV
|
||||
MS_NOEXEC = 8, /* Disallow program execution. */
|
||||
#define MS_NOEXEC MS_NOEXEC
|
||||
MS_SYNCHRONOUS = 16, /* Writes are synced at once. */
|
||||
#define MS_SYNCHRONOUS MS_SYNCHRONOUS
|
||||
MS_REMOUNT = 32, /* Alter flags of a mounted FS. */
|
||||
#define MS_REMOUNT MS_REMOUNT
|
||||
MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
|
||||
#define MS_MANDLOCK MS_MANDLOCK
|
||||
S_WRITE = 128, /* Write on file/directory/symlink. */
|
||||
#define S_WRITE S_WRITE
|
||||
S_APPEND = 256, /* Append-only file. */
|
||||
#define S_APPEND S_APPEND
|
||||
S_IMMUTABLE = 512, /* Immutable file. */
|
||||
#define S_IMMUTABLE S_IMMUTABLE
|
||||
MS_NOATIME = 1024, /* Do not update access times. */
|
||||
#define MS_NOATIME MS_NOATIME
|
||||
MS_NODIRATIME = 2048, /* Do not update directory access times. */
|
||||
#define MS_NODIRATIME MS_NODIRATIME
|
||||
MS_BIND = 4096, /* Bind directory at different place. */
|
||||
#define MS_BIND MS_BIND
|
||||
};
|
||||
|
||||
/* Flags that can be altered by MS_REMOUNT */
|
||||
#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
|
||||
|MS_NODIRATIME)
|
||||
|
||||
|
||||
/* Magic mount flag number. Has to be or-ed to the flag values. */
|
||||
|
||||
#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
|
||||
#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */
|
||||
|
||||
|
||||
/* The read-only stuff doesn't really belong here, but any other place
|
||||
is probably as bad and I don't want to create yet another include
|
||||
file. */
|
||||
|
||||
#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
|
||||
#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
|
||||
#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
|
||||
#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
|
||||
#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
|
||||
#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
|
||||
#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
|
||||
#define BLKFRASET _IO(0x12,100) /* Set filesystem read-ahead. */
|
||||
#define BLKFRAGET _IO(0x12,101) /* Get filesystem read-ahead. */
|
||||
#define BLKSECTSET _IO(0x12,102) /* Set max sectors per request. */
|
||||
#define BLKSECTGET _IO(0x12,103) /* Get max sectors per request. */
|
||||
#define BLKSSZGET _IO(0x12,104) /* Get block device sector size. */
|
||||
#define BLKBSZGET _IOR(0x12,112,size_t)
|
||||
#define BLKBSZSET _IOW(0x12,113,size_t)
|
||||
#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size. */
|
||||
|
||||
|
||||
/* Possible value for FLAGS parameter of `umount2'. */
|
||||
enum
|
||||
{
|
||||
MNT_FORCE = 1 /* Force unmounting. */
|
||||
#define MNT_FORCE MNT_FORCE
|
||||
};
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Mount a filesystem. */
|
||||
extern int mount (__const char *__special_file, __const char *__dir,
|
||||
__const char *__fstype, unsigned long int __rwflag,
|
||||
__const void *__data) __THROW;
|
||||
|
||||
/* Unmount a filesystem. */
|
||||
extern int umount (__const char *__special_file) __THROW;
|
||||
|
||||
/* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */
|
||||
extern int umount2 (__const char *__special_file, int __flags) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_MOUNT_H */
|
||||
81
tasks/libposix/include/posix/sys/msg.h
Normal file
81
tasks/libposix/include/posix/sys/msg.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/* Copyright (C) 1995,1996,1997,1999,2000,2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_MSG_H
|
||||
#define _SYS_MSG_H
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get common definition of System V style IPC. */
|
||||
#include <sys/ipc.h>
|
||||
|
||||
/* Get system dependent definition of `struct msqid_ds' and more. */
|
||||
#include <bits/msq.h>
|
||||
|
||||
/* Define types required by the standard. */
|
||||
#define __need_time_t
|
||||
#include <time.h>
|
||||
|
||||
#ifndef __pid_t_defined
|
||||
typedef __pid_t pid_t;
|
||||
# define __pid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __ssize_t_defined
|
||||
typedef __ssize_t ssize_t;
|
||||
# define __ssize_t_defined
|
||||
#endif
|
||||
|
||||
/* The following System V style IPC functions implement a message queue
|
||||
system. The definition is found in XPG2. */
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */
|
||||
struct msgbuf
|
||||
{
|
||||
long int mtype; /* type of received/sent message */
|
||||
char mtext[1]; /* text of the message */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Message queue control operation. */
|
||||
extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
|
||||
|
||||
/* Get messages queue. */
|
||||
extern int msgget (key_t __key, int __msgflg) __THROW;
|
||||
|
||||
/* Receive message from message queue.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int msgrcv (int __msqid, void *__msgp, size_t __msgsz,
|
||||
long int __msgtyp, int __msgflg);
|
||||
|
||||
/* Send message to message queue.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int msgsnd (int __msqid, __const void *__msgp, size_t __msgsz,
|
||||
int __msgflg);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/msg.h */
|
||||
277
tasks/libposix/include/posix/sys/mtio.h
Normal file
277
tasks/libposix/include/posix/sys/mtio.h
Normal file
@@ -0,0 +1,277 @@
|
||||
/* Structures and definitions for magnetic tape I/O control commands.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* Written by H. Bergman <hennus@cybercomm.nl>. */
|
||||
|
||||
#ifndef _SYS_MTIO_H
|
||||
#define _SYS_MTIO_H 1
|
||||
|
||||
/* Get necessary definitions from system and kernel headers. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
|
||||
/* Structure for MTIOCTOP - magnetic tape operation command. */
|
||||
struct mtop
|
||||
{
|
||||
short int mt_op; /* Operations defined below. */
|
||||
int mt_count; /* How many of them. */
|
||||
};
|
||||
#define _IOT_mtop /* Hurd ioctl type field. */ \
|
||||
_IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0)
|
||||
|
||||
/* Magnetic Tape operations [Not all operations supported by all drivers]. */
|
||||
#define MTRESET 0 /* +reset drive in case of problems. */
|
||||
#define MTFSF 1 /* Forward space over FileMark,
|
||||
* position at first record of next file. */
|
||||
#define MTBSF 2 /* Backward space FileMark (position before FM). */
|
||||
#define MTFSR 3 /* Forward space record. */
|
||||
#define MTBSR 4 /* Backward space record. */
|
||||
#define MTWEOF 5 /* Write an end-of-file record (mark). */
|
||||
#define MTREW 6 /* Rewind. */
|
||||
#define MTOFFL 7 /* Rewind and put the drive offline (eject?). */
|
||||
#define MTNOP 8 /* No op, set status only (read with MTIOCGET). */
|
||||
#define MTRETEN 9 /* Retension tape. */
|
||||
#define MTBSFM 10 /* +backward space FileMark, position at FM. */
|
||||
#define MTFSFM 11 /* +forward space FileMark, position at FM. */
|
||||
#define MTEOM 12 /* Goto end of recorded media (for appending files).
|
||||
MTEOM positions after the last FM, ready for
|
||||
appending another file. */
|
||||
#define MTERASE 13 /* Erase tape -- be careful! */
|
||||
|
||||
#define MTRAS1 14 /* Run self test 1 (nondestructive). */
|
||||
#define MTRAS2 15 /* Run self test 2 (destructive). */
|
||||
#define MTRAS3 16 /* Reserved for self test 3. */
|
||||
|
||||
#define MTSETBLK 20 /* Set block length (SCSI). */
|
||||
#define MTSETDENSITY 21 /* Set tape density (SCSI). */
|
||||
#define MTSEEK 22 /* Seek to block (Tandberg, etc.). */
|
||||
#define MTTELL 23 /* Tell block (Tandberg, etc.). */
|
||||
#define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2.
|
||||
Ordinary buffered operation with code 1. */
|
||||
#define MTFSS 25 /* Space forward over setmarks. */
|
||||
#define MTBSS 26 /* Space backward over setmarks. */
|
||||
#define MTWSM 27 /* Write setmarks. */
|
||||
|
||||
#define MTLOCK 28 /* Lock the drive door. */
|
||||
#define MTUNLOCK 29 /* Unlock the drive door. */
|
||||
#define MTLOAD 30 /* Execute the SCSI load command. */
|
||||
#define MTUNLOAD 31 /* Execute the SCSI unload command. */
|
||||
#define MTCOMPRESSION 32/* Control compression with SCSI mode page 15. */
|
||||
#define MTSETPART 33 /* Change the active tape partition. */
|
||||
#define MTMKPART 34 /* Format the tape with one or two partitions. */
|
||||
|
||||
/* structure for MTIOCGET - mag tape get status command */
|
||||
|
||||
struct mtget
|
||||
{
|
||||
long int mt_type; /* Type of magtape device. */
|
||||
long int mt_resid; /* Residual count: (not sure)
|
||||
number of bytes ignored, or
|
||||
number of files not skipped, or
|
||||
number of records not skipped. */
|
||||
/* The following registers are device dependent. */
|
||||
long int mt_dsreg; /* Status register. */
|
||||
long int mt_gstat; /* Generic (device independent) status. */
|
||||
long int mt_erreg; /* Error register. */
|
||||
/* The next two fields are not always used. */
|
||||
__daddr_t mt_fileno; /* Number of current file on tape. */
|
||||
__daddr_t mt_blkno; /* Current block number. */
|
||||
};
|
||||
#define _IOT_mtget /* Hurd ioctl type field. */ \
|
||||
_IOT (_IOTS (long), 7, 0, 0, 0, 0)
|
||||
|
||||
|
||||
/* Constants for mt_type. Not all of these are supported, and
|
||||
these are not all of the ones that are supported. */
|
||||
#define MT_ISUNKNOWN 0x01
|
||||
#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer. */
|
||||
#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02. */
|
||||
#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02?. */
|
||||
#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?). */
|
||||
#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24. */
|
||||
#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02. */
|
||||
#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L. */
|
||||
#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L. */
|
||||
#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller. */
|
||||
#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features. */
|
||||
#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24. */
|
||||
#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive,
|
||||
Teac DC-1 card (Wangtek type). */
|
||||
#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40). */
|
||||
#define MT_ISDDS1 0x51 /* DDS device without partitions. */
|
||||
#define MT_ISDDS2 0x52 /* DDS device with partitions. */
|
||||
#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit. */
|
||||
#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit. */
|
||||
|
||||
/* QIC-40/80/3010/3020 ftape supported drives.
|
||||
20bit vendor ID + 0x800000 (see vendors.h in ftape distribution). */
|
||||
#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
|
||||
#define MT_ISFTAPE_FLAG 0x800000
|
||||
|
||||
struct mt_tape_info
|
||||
{
|
||||
long int t_type; /* Device type id (mt_type). */
|
||||
char *t_name; /* Descriptive name. */
|
||||
};
|
||||
|
||||
#define MT_TAPE_INFO \
|
||||
{ \
|
||||
{MT_ISUNKNOWN, "Unknown type of tape device"}, \
|
||||
{MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
|
||||
{MT_ISWT5150, "Wangtek 5150, QIC-150"}, \
|
||||
{MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \
|
||||
{MT_ISCMSJ500, "CMS Jumbo 500"}, \
|
||||
{MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \
|
||||
{MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \
|
||||
{MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \
|
||||
{MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \
|
||||
{MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \
|
||||
{MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \
|
||||
{MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
|
||||
{MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \
|
||||
{MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
|
||||
{MT_ISSCSI1, "Generic SCSI-1 tape"}, \
|
||||
{MT_ISSCSI2, "Generic SCSI-2 tape"}, \
|
||||
{0, NULL} \
|
||||
}
|
||||
|
||||
|
||||
/* Structure for MTIOCPOS - mag tape get position command. */
|
||||
|
||||
struct mtpos
|
||||
{
|
||||
long int mt_blkno; /* Current block number. */
|
||||
};
|
||||
#define _IOT_mtpos /* Hurd ioctl type field. */ \
|
||||
_IOT_SIMPLE (long)
|
||||
|
||||
|
||||
/* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended
|
||||
as an interim solution for QIC-02 until DDI is fully implemented. */
|
||||
struct mtconfiginfo
|
||||
{
|
||||
long int mt_type; /* Drive type. */
|
||||
long int ifc_type; /* Interface card type. */
|
||||
unsigned short int irqnr; /* IRQ number to use. */
|
||||
unsigned short int dmanr; /* DMA channel to use. */
|
||||
unsigned short int port; /* IO port base address. */
|
||||
|
||||
unsigned long int debug; /* Debugging flags. */
|
||||
|
||||
unsigned have_dens:1;
|
||||
unsigned have_bsf:1;
|
||||
unsigned have_fsr:1;
|
||||
unsigned have_bsr:1;
|
||||
unsigned have_eod:1;
|
||||
unsigned have_seek:1;
|
||||
unsigned have_tell:1;
|
||||
unsigned have_ras1:1;
|
||||
unsigned have_ras2:1;
|
||||
unsigned have_ras3:1;
|
||||
unsigned have_qfa:1;
|
||||
|
||||
unsigned pad1:5;
|
||||
char reserved[10];
|
||||
};
|
||||
#define _IOT_mtconfiginfo /* Hurd ioctl type field. */ \
|
||||
_IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) /* XXX wrong */
|
||||
|
||||
|
||||
/* Magnetic tape I/O control commands. */
|
||||
#define MTIOCTOP _IOW('m', 1, struct mtop) /* Do a mag tape op. */
|
||||
#define MTIOCGET _IOR('m', 2, struct mtget) /* Get tape status. */
|
||||
#define MTIOCPOS _IOR('m', 3, struct mtpos) /* Get tape position.*/
|
||||
|
||||
/* The next two are used by the QIC-02 driver for runtime reconfiguration.
|
||||
See tpqic02.h for struct mtconfiginfo. */
|
||||
#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/
|
||||
#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/
|
||||
|
||||
/* Generic Mag Tape (device independent) status macros for examining
|
||||
mt_gstat -- HP-UX compatible.
|
||||
There is room for more generic status bits here, but I don't
|
||||
know which of them are reserved. At least three or so should
|
||||
be added to make this really useful. */
|
||||
#define GMT_EOF(x) ((x) & 0x80000000)
|
||||
#define GMT_BOT(x) ((x) & 0x40000000)
|
||||
#define GMT_EOT(x) ((x) & 0x20000000)
|
||||
#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
|
||||
#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
|
||||
#define GMT_WR_PROT(x) ((x) & 0x04000000)
|
||||
/* #define GMT_ ? ((x) & 0x02000000) */
|
||||
#define GMT_ONLINE(x) ((x) & 0x01000000)
|
||||
#define GMT_D_6250(x) ((x) & 0x00800000)
|
||||
#define GMT_D_1600(x) ((x) & 0x00400000)
|
||||
#define GMT_D_800(x) ((x) & 0x00200000)
|
||||
/* #define GMT_ ? ((x) & 0x00100000) */
|
||||
/* #define GMT_ ? ((x) & 0x00080000) */
|
||||
#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* Door open (no tape). */
|
||||
/* #define GMT_ ? ((x) & 0x00020000) */
|
||||
#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* Immediate report mode.*/
|
||||
/* 16 generic status bits unused. */
|
||||
|
||||
|
||||
/* SCSI-tape specific definitions. Bitfield shifts in the status */
|
||||
#define MT_ST_BLKSIZE_SHIFT 0
|
||||
#define MT_ST_BLKSIZE_MASK 0xffffff
|
||||
#define MT_ST_DENSITY_SHIFT 24
|
||||
#define MT_ST_DENSITY_MASK 0xff000000
|
||||
|
||||
#define MT_ST_SOFTERR_SHIFT 0
|
||||
#define MT_ST_SOFTERR_MASK 0xffff
|
||||
|
||||
/* Bitfields for the MTSETDRVBUFFER ioctl. */
|
||||
#define MT_ST_OPTIONS 0xf0000000
|
||||
#define MT_ST_BOOLEANS 0x10000000
|
||||
#define MT_ST_SETBOOLEANS 0x30000000
|
||||
#define MT_ST_CLEARBOOLEANS 0x40000000
|
||||
#define MT_ST_WRITE_THRESHOLD 0x20000000
|
||||
#define MT_ST_DEF_BLKSIZE 0x50000000
|
||||
#define MT_ST_DEF_OPTIONS 0x60000000
|
||||
|
||||
#define MT_ST_BUFFER_WRITES 0x1
|
||||
#define MT_ST_ASYNC_WRITES 0x2
|
||||
#define MT_ST_READ_AHEAD 0x4
|
||||
#define MT_ST_DEBUGGING 0x8
|
||||
#define MT_ST_TWO_FM 0x10
|
||||
#define MT_ST_FAST_MTEOM 0x20
|
||||
#define MT_ST_AUTO_LOCK 0x40
|
||||
#define MT_ST_DEF_WRITES 0x80
|
||||
#define MT_ST_CAN_BSR 0x100
|
||||
#define MT_ST_NO_BLKLIMS 0x200
|
||||
#define MT_ST_CAN_PARTITIONS 0x400
|
||||
#define MT_ST_SCSI2LOGICAL 0x800
|
||||
|
||||
/* The mode parameters to be controlled. Parameter chosen with bits 20-28. */
|
||||
#define MT_ST_CLEAR_DEFAULT 0xfffff
|
||||
#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
|
||||
#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
|
||||
#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
|
||||
|
||||
/* The offset for the arguments for the special HP changer load command. */
|
||||
#define MT_ST_HPLOADER_OFFSET 10000
|
||||
|
||||
|
||||
/* Specify default tape device. */
|
||||
#ifndef DEFTAPE
|
||||
# define DEFTAPE "/dev/tape"
|
||||
#endif
|
||||
|
||||
#endif /* mtio.h */
|
||||
72
tasks/libposix/include/posix/sys/param.h
Normal file
72
tasks/libposix/include/posix/sys/param.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* Copyright (C) 1995,1996,1997,2000,2001,2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_PARAM_H
|
||||
#define _SYS_PARAM_H 1
|
||||
|
||||
#include <limits.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/param.h>
|
||||
|
||||
/* BSD names for some <limits.h> values. */
|
||||
|
||||
#define NBBY CHAR_BIT
|
||||
#ifndef NGROUPS
|
||||
# define NGROUPS NGROUPS_MAX
|
||||
#endif
|
||||
#define MAXSYMLINKS 20
|
||||
#define CANBSIZ MAX_CANON
|
||||
#define NCARGS ARG_MAX
|
||||
#define MAXPATHLEN PATH_MAX
|
||||
/* The following is not really correct but it is a value we used for a
|
||||
long time and which seems to be usable. People should not use NOFILE
|
||||
anyway. */
|
||||
#define NOFILE 256
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Bit map related macros. */
|
||||
#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
|
||||
#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
|
||||
#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
|
||||
#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
|
||||
|
||||
/* Macros for counting and rounding. */
|
||||
#ifndef howmany
|
||||
# define howmany(x, y) (((x) + ((y) - 1)) / (y))
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
# define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \
|
||||
? (((x) + (y) - 1) & ~((y) - 1)) \
|
||||
: ((((x) + ((y) - 1)) / (y)) * (y)))
|
||||
#else
|
||||
# define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
|
||||
#endif
|
||||
#define powerof2(x) ((((x) - 1) & (x)) == 0)
|
||||
|
||||
/* Macros for min/max. */
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
|
||||
|
||||
/* Unit of `st_blocks'. */
|
||||
#define DEV_BSIZE 512
|
||||
|
||||
|
||||
#endif /* sys/param.h */
|
||||
73
tasks/libposix/include/posix/sys/personality.h
Normal file
73
tasks/libposix/include/posix/sys/personality.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/* Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* Taken verbatim from Linux 2.4 (include/linux/personality.h). */
|
||||
|
||||
#ifndef _SYS_PERSONALITY_H
|
||||
#define _SYS_PERSONALITY_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Flags for bug emulation.
|
||||
These occupy the top three bytes. */
|
||||
enum
|
||||
{
|
||||
MMAP_PAGE_ZERO = 0x0100000,
|
||||
ADDR_LIMIT_32BIT = 0x0800000,
|
||||
SHORT_INODE = 0x1000000,
|
||||
WHOLE_SECONDS = 0x2000000,
|
||||
STICKY_TIMEOUTS = 0x4000000,
|
||||
};
|
||||
|
||||
/* Personality types.
|
||||
|
||||
These go in the low byte. Avoid using the top bit, it will
|
||||
conflict with error returns. */
|
||||
enum
|
||||
{
|
||||
PER_LINUX = 0x0000,
|
||||
PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
|
||||
PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||
PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE,
|
||||
PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
|
||||
PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
|
||||
PER_BSD = 0x0006,
|
||||
PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
|
||||
PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_LINUX32 = 0x0008,
|
||||
PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS, /* IRIX5 32-bit */
|
||||
PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS, /* IRIX6 new 32-bit */
|
||||
PER_IRIX64 = 0x000b | STICKY_TIMEOUTS, /* IRIX6 64-bit */
|
||||
PER_RISCOS = 0x000c,
|
||||
PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
|
||||
PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||
PER_HPUX = 0x000f,
|
||||
PER_OSF4 = 0x0010,
|
||||
PER_MASK = 0x00ff,
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Set different ABIs (personalities). */
|
||||
extern int personality (unsigned long int __persona) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/personality.h */
|
||||
76
tasks/libposix/include/posix/sys/poll.h
Normal file
76
tasks/libposix/include/posix/sys/poll.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/* Compatibility definitions for System V `poll' interface.
|
||||
Copyright (C) 1994,1996-2001,2004,2005,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_POLL_H
|
||||
#define _SYS_POLL_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the platform dependent bits of `poll'. */
|
||||
#include <bits/poll.h>
|
||||
#ifdef __USE_GNU
|
||||
/* Get the __sigset_t definition. */
|
||||
# include <bits/sigset.h>
|
||||
/* Get the timespec definition. */
|
||||
# define __need_timespec
|
||||
# include <time.h>
|
||||
/* get NULL definition. */
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Type used for the number of file descriptors. */
|
||||
typedef unsigned long int nfds_t;
|
||||
|
||||
/* Data structure describing a polling request. */
|
||||
struct pollfd
|
||||
{
|
||||
int fd; /* File descriptor to poll. */
|
||||
short int events; /* Types of events poller cares about. */
|
||||
short int revents; /* Types of events that actually occurred. */
|
||||
};
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Poll the file descriptors described by the NFDS structures starting at
|
||||
FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
|
||||
an event to occur; if TIMEOUT is -1, block until an event occurs.
|
||||
Returns the number of file descriptors with events, zero if timed out,
|
||||
or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Like poll, but before waiting the threads signal mask is replaced
|
||||
with that specified in the fourth parameter. For better usability,
|
||||
the timeout value is specified using a TIMESPEC object.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
|
||||
__const struct timespec *__timeout,
|
||||
__const __sigset_t *__ss);
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/poll.h */
|
||||
557
tasks/libposix/include/posix/sys/queue.h
Normal file
557
tasks/libposix/include/posix/sys/queue.h
Normal file
@@ -0,0 +1,557 @@
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)queue.h 8.5 (Berkeley) 8/20/94
|
||||
*/
|
||||
|
||||
#ifndef _SYS_QUEUE_H_
|
||||
#define _SYS_QUEUE_H_
|
||||
|
||||
/*
|
||||
* This file defines five types of data structures: singly-linked lists,
|
||||
* lists, simple queues, tail queues, and circular queues.
|
||||
*
|
||||
* A singly-linked list is headed by a single forward pointer. The
|
||||
* elements are singly linked for minimum space and pointer manipulation
|
||||
* overhead at the expense of O(n) removal for arbitrary elements. New
|
||||
* elements can be added to the list after an existing element or at the
|
||||
* head of the list. Elements being removed from the head of the list
|
||||
* should use the explicit macro for this purpose for optimum
|
||||
* efficiency. A singly-linked list may only be traversed in the forward
|
||||
* direction. Singly-linked lists are ideal for applications with large
|
||||
* datasets and few or no removals or for implementing a LIFO queue.
|
||||
*
|
||||
* A list is headed by a single forward pointer (or an array of forward
|
||||
* pointers for a hash table header). The elements are doubly linked
|
||||
* so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list before
|
||||
* or after an existing element or at the head of the list. A list
|
||||
* may only be traversed in the forward direction.
|
||||
*
|
||||
* A simple queue is headed by a pair of pointers, one the head of the
|
||||
* list and the other to the tail of the list. The elements are singly
|
||||
* linked to save space, so elements can only be removed from the
|
||||
* head of the list. New elements can be added to the list after
|
||||
* an existing element, at the head of the list, or at the end of the
|
||||
* list. A simple queue may only be traversed in the forward direction.
|
||||
*
|
||||
* A tail queue is headed by a pair of pointers, one to the head of the
|
||||
* list and the other to the tail of the list. The elements are doubly
|
||||
* linked so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list before or
|
||||
* after an existing element, at the head of the list, or at the end of
|
||||
* the list. A tail queue may be traversed in either direction.
|
||||
*
|
||||
* A circle queue is headed by a pair of pointers, one to the head of the
|
||||
* list and the other to the tail of the list. The elements are doubly
|
||||
* linked so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list before or after
|
||||
* an existing element, at the head of the list, or at the end of the list.
|
||||
* A circle queue may be traversed in either direction, but has a more
|
||||
* complex end of list detection.
|
||||
*
|
||||
* For details on the use of these macros, see the queue(3) manual page.
|
||||
*/
|
||||
|
||||
/*
|
||||
* List definitions.
|
||||
*/
|
||||
#define LIST_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *lh_first; /* first element */ \
|
||||
}
|
||||
|
||||
#define LIST_HEAD_INITIALIZER(head) \
|
||||
{ NULL }
|
||||
|
||||
#define LIST_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *le_next; /* next element */ \
|
||||
struct type **le_prev; /* address of previous next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* List functions.
|
||||
*/
|
||||
#define LIST_INIT(head) do { \
|
||||
(head)->lh_first = NULL; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_INSERT_AFTER(listelm, elm, field) do { \
|
||||
if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
|
||||
(listelm)->field.le_next->field.le_prev = \
|
||||
&(elm)->field.le_next; \
|
||||
(listelm)->field.le_next = (elm); \
|
||||
(elm)->field.le_prev = &(listelm)->field.le_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
|
||||
(elm)->field.le_prev = (listelm)->field.le_prev; \
|
||||
(elm)->field.le_next = (listelm); \
|
||||
*(listelm)->field.le_prev = (elm); \
|
||||
(listelm)->field.le_prev = &(elm)->field.le_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_INSERT_HEAD(head, elm, field) do { \
|
||||
if (((elm)->field.le_next = (head)->lh_first) != NULL) \
|
||||
(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
|
||||
(head)->lh_first = (elm); \
|
||||
(elm)->field.le_prev = &(head)->lh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_REMOVE(elm, field) do { \
|
||||
if ((elm)->field.le_next != NULL) \
|
||||
(elm)->field.le_next->field.le_prev = \
|
||||
(elm)->field.le_prev; \
|
||||
*(elm)->field.le_prev = (elm)->field.le_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->lh_first); \
|
||||
(var); \
|
||||
(var) = ((var)->field.le_next))
|
||||
|
||||
/*
|
||||
* List access methods.
|
||||
*/
|
||||
#define LIST_EMPTY(head) ((head)->lh_first == NULL)
|
||||
#define LIST_FIRST(head) ((head)->lh_first)
|
||||
#define LIST_NEXT(elm, field) ((elm)->field.le_next)
|
||||
|
||||
|
||||
/*
|
||||
* Singly-linked List definitions.
|
||||
*/
|
||||
#define SLIST_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *slh_first; /* first element */ \
|
||||
}
|
||||
|
||||
#define SLIST_HEAD_INITIALIZER(head) \
|
||||
{ NULL }
|
||||
|
||||
#define SLIST_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *sle_next; /* next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Singly-linked List functions.
|
||||
*/
|
||||
#define SLIST_INIT(head) do { \
|
||||
(head)->slh_first = NULL; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
|
||||
(elm)->field.sle_next = (slistelm)->field.sle_next; \
|
||||
(slistelm)->field.sle_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_INSERT_HEAD(head, elm, field) do { \
|
||||
(elm)->field.sle_next = (head)->slh_first; \
|
||||
(head)->slh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_REMOVE_HEAD(head, field) do { \
|
||||
(head)->slh_first = (head)->slh_first->field.sle_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->slh_first == (elm)) { \
|
||||
SLIST_REMOVE_HEAD((head), field); \
|
||||
} \
|
||||
else { \
|
||||
struct type *curelm = (head)->slh_first; \
|
||||
while(curelm->field.sle_next != (elm)) \
|
||||
curelm = curelm->field.sle_next; \
|
||||
curelm->field.sle_next = \
|
||||
curelm->field.sle_next->field.sle_next; \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_FOREACH(var, head, field) \
|
||||
for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
|
||||
|
||||
/*
|
||||
* Singly-linked List access methods.
|
||||
*/
|
||||
#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
|
||||
#define SLIST_FIRST(head) ((head)->slh_first)
|
||||
#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
|
||||
|
||||
|
||||
/*
|
||||
* Singly-linked Tail queue declarations.
|
||||
*/
|
||||
#define STAILQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *stqh_first; /* first element */ \
|
||||
struct type **stqh_last; /* addr of last next element */ \
|
||||
}
|
||||
|
||||
#define STAILQ_HEAD_INITIALIZER(head) \
|
||||
{ NULL, &(head).stqh_first }
|
||||
|
||||
#define STAILQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *stqe_next; /* next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Singly-linked Tail queue functions.
|
||||
*/
|
||||
#define STAILQ_INIT(head) do { \
|
||||
(head)->stqh_first = NULL; \
|
||||
(head)->stqh_last = &(head)->stqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_INSERT_HEAD(head, elm, field) do { \
|
||||
if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
|
||||
(head)->stqh_last = &(elm)->field.stqe_next; \
|
||||
(head)->stqh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_INSERT_TAIL(head, elm, field) do { \
|
||||
(elm)->field.stqe_next = NULL; \
|
||||
*(head)->stqh_last = (elm); \
|
||||
(head)->stqh_last = &(elm)->field.stqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
||||
if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
|
||||
(head)->stqh_last = &(elm)->field.stqe_next; \
|
||||
(listelm)->field.stqe_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_REMOVE_HEAD(head, field) do { \
|
||||
if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
|
||||
(head)->stqh_last = &(head)->stqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->stqh_first == (elm)) { \
|
||||
STAILQ_REMOVE_HEAD((head), field); \
|
||||
} else { \
|
||||
struct type *curelm = (head)->stqh_first; \
|
||||
while (curelm->field.stqe_next != (elm)) \
|
||||
curelm = curelm->field.stqe_next; \
|
||||
if ((curelm->field.stqe_next = \
|
||||
curelm->field.stqe_next->field.stqe_next) == NULL) \
|
||||
(head)->stqh_last = &(curelm)->field.stqe_next; \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->stqh_first); \
|
||||
(var); \
|
||||
(var) = ((var)->field.stqe_next))
|
||||
|
||||
/*
|
||||
* Singly-linked Tail queue access methods.
|
||||
*/
|
||||
#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
|
||||
#define STAILQ_FIRST(head) ((head)->stqh_first)
|
||||
#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
|
||||
|
||||
|
||||
/*
|
||||
* Simple queue definitions.
|
||||
*/
|
||||
#define SIMPLEQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *sqh_first; /* first element */ \
|
||||
struct type **sqh_last; /* addr of last next element */ \
|
||||
}
|
||||
|
||||
#define SIMPLEQ_HEAD_INITIALIZER(head) \
|
||||
{ NULL, &(head).sqh_first }
|
||||
|
||||
#define SIMPLEQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *sqe_next; /* next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Simple queue functions.
|
||||
*/
|
||||
#define SIMPLEQ_INIT(head) do { \
|
||||
(head)->sqh_first = NULL; \
|
||||
(head)->sqh_last = &(head)->sqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
|
||||
if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
|
||||
(head)->sqh_last = &(elm)->field.sqe_next; \
|
||||
(head)->sqh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
|
||||
(elm)->field.sqe_next = NULL; \
|
||||
*(head)->sqh_last = (elm); \
|
||||
(head)->sqh_last = &(elm)->field.sqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
||||
if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
|
||||
(head)->sqh_last = &(elm)->field.sqe_next; \
|
||||
(listelm)->field.sqe_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
|
||||
if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
|
||||
(head)->sqh_last = &(head)->sqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->sqh_first == (elm)) { \
|
||||
SIMPLEQ_REMOVE_HEAD((head), field); \
|
||||
} else { \
|
||||
struct type *curelm = (head)->sqh_first; \
|
||||
while (curelm->field.sqe_next != (elm)) \
|
||||
curelm = curelm->field.sqe_next; \
|
||||
if ((curelm->field.sqe_next = \
|
||||
curelm->field.sqe_next->field.sqe_next) == NULL) \
|
||||
(head)->sqh_last = &(curelm)->field.sqe_next; \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->sqh_first); \
|
||||
(var); \
|
||||
(var) = ((var)->field.sqe_next))
|
||||
|
||||
/*
|
||||
* Simple queue access methods.
|
||||
*/
|
||||
#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL)
|
||||
#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
|
||||
#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
|
||||
|
||||
|
||||
/*
|
||||
* Tail queue definitions.
|
||||
*/
|
||||
#define _TAILQ_HEAD(name, type, qual) \
|
||||
struct name { \
|
||||
qual type *tqh_first; /* first element */ \
|
||||
qual type *qual *tqh_last; /* addr of last next element */ \
|
||||
}
|
||||
#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
|
||||
|
||||
#define TAILQ_HEAD_INITIALIZER(head) \
|
||||
{ NULL, &(head).tqh_first }
|
||||
|
||||
#define _TAILQ_ENTRY(type, qual) \
|
||||
struct { \
|
||||
qual type *tqe_next; /* next element */ \
|
||||
qual type *qual *tqe_prev; /* address of previous next element */\
|
||||
}
|
||||
#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
|
||||
|
||||
/*
|
||||
* Tail queue functions.
|
||||
*/
|
||||
#define TAILQ_INIT(head) do { \
|
||||
(head)->tqh_first = NULL; \
|
||||
(head)->tqh_last = &(head)->tqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_INSERT_HEAD(head, elm, field) do { \
|
||||
if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
|
||||
(head)->tqh_first->field.tqe_prev = \
|
||||
&(elm)->field.tqe_next; \
|
||||
else \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
(head)->tqh_first = (elm); \
|
||||
(elm)->field.tqe_prev = &(head)->tqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_INSERT_TAIL(head, elm, field) do { \
|
||||
(elm)->field.tqe_next = NULL; \
|
||||
(elm)->field.tqe_prev = (head)->tqh_last; \
|
||||
*(head)->tqh_last = (elm); \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
||||
if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
|
||||
(elm)->field.tqe_next->field.tqe_prev = \
|
||||
&(elm)->field.tqe_next; \
|
||||
else \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
(listelm)->field.tqe_next = (elm); \
|
||||
(elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
|
||||
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
|
||||
(elm)->field.tqe_next = (listelm); \
|
||||
*(listelm)->field.tqe_prev = (elm); \
|
||||
(listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_REMOVE(head, elm, field) do { \
|
||||
if (((elm)->field.tqe_next) != NULL) \
|
||||
(elm)->field.tqe_next->field.tqe_prev = \
|
||||
(elm)->field.tqe_prev; \
|
||||
else \
|
||||
(head)->tqh_last = (elm)->field.tqe_prev; \
|
||||
*(elm)->field.tqe_prev = (elm)->field.tqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->tqh_first); \
|
||||
(var); \
|
||||
(var) = ((var)->field.tqe_next))
|
||||
|
||||
#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
|
||||
for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
|
||||
(var); \
|
||||
(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
|
||||
|
||||
/*
|
||||
* Tail queue access methods.
|
||||
*/
|
||||
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
|
||||
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
||||
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
|
||||
|
||||
#define TAILQ_LAST(head, headname) \
|
||||
(*(((struct headname *)((head)->tqh_last))->tqh_last))
|
||||
#define TAILQ_PREV(elm, headname, field) \
|
||||
(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
|
||||
|
||||
|
||||
/*
|
||||
* Circular queue definitions.
|
||||
*/
|
||||
#define CIRCLEQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *cqh_first; /* first element */ \
|
||||
struct type *cqh_last; /* last element */ \
|
||||
}
|
||||
|
||||
#define CIRCLEQ_HEAD_INITIALIZER(head) \
|
||||
{ (void *)&head, (void *)&head }
|
||||
|
||||
#define CIRCLEQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *cqe_next; /* next element */ \
|
||||
struct type *cqe_prev; /* previous element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Circular queue functions.
|
||||
*/
|
||||
#define CIRCLEQ_INIT(head) do { \
|
||||
(head)->cqh_first = (void *)(head); \
|
||||
(head)->cqh_last = (void *)(head); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
||||
(elm)->field.cqe_next = (listelm)->field.cqe_next; \
|
||||
(elm)->field.cqe_prev = (listelm); \
|
||||
if ((listelm)->field.cqe_next == (void *)(head)) \
|
||||
(head)->cqh_last = (elm); \
|
||||
else \
|
||||
(listelm)->field.cqe_next->field.cqe_prev = (elm); \
|
||||
(listelm)->field.cqe_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
|
||||
(elm)->field.cqe_next = (listelm); \
|
||||
(elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
|
||||
if ((listelm)->field.cqe_prev == (void *)(head)) \
|
||||
(head)->cqh_first = (elm); \
|
||||
else \
|
||||
(listelm)->field.cqe_prev->field.cqe_next = (elm); \
|
||||
(listelm)->field.cqe_prev = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
|
||||
(elm)->field.cqe_next = (head)->cqh_first; \
|
||||
(elm)->field.cqe_prev = (void *)(head); \
|
||||
if ((head)->cqh_last == (void *)(head)) \
|
||||
(head)->cqh_last = (elm); \
|
||||
else \
|
||||
(head)->cqh_first->field.cqe_prev = (elm); \
|
||||
(head)->cqh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
|
||||
(elm)->field.cqe_next = (void *)(head); \
|
||||
(elm)->field.cqe_prev = (head)->cqh_last; \
|
||||
if ((head)->cqh_first == (void *)(head)) \
|
||||
(head)->cqh_first = (elm); \
|
||||
else \
|
||||
(head)->cqh_last->field.cqe_next = (elm); \
|
||||
(head)->cqh_last = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_REMOVE(head, elm, field) do { \
|
||||
if ((elm)->field.cqe_next == (void *)(head)) \
|
||||
(head)->cqh_last = (elm)->field.cqe_prev; \
|
||||
else \
|
||||
(elm)->field.cqe_next->field.cqe_prev = \
|
||||
(elm)->field.cqe_prev; \
|
||||
if ((elm)->field.cqe_prev == (void *)(head)) \
|
||||
(head)->cqh_first = (elm)->field.cqe_next; \
|
||||
else \
|
||||
(elm)->field.cqe_prev->field.cqe_next = \
|
||||
(elm)->field.cqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->cqh_first); \
|
||||
(var) != (const void *)(head); \
|
||||
(var) = ((var)->field.cqe_next))
|
||||
|
||||
#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
|
||||
for ((var) = ((head)->cqh_last); \
|
||||
(var) != (const void *)(head); \
|
||||
(var) = ((var)->field.cqe_prev))
|
||||
|
||||
/*
|
||||
* Circular queue access methods.
|
||||
*/
|
||||
#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
|
||||
#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
|
||||
#define CIRCLEQ_LAST(head) ((head)->cqh_last)
|
||||
#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
|
||||
#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
|
||||
|
||||
#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
|
||||
(((elm)->field.cqe_next == (void *)(head)) \
|
||||
? ((head)->cqh_first) \
|
||||
: (elm->field.cqe_next))
|
||||
#define CIRCLEQ_LOOP_PREV(head, elm, field) \
|
||||
(((elm)->field.cqe_prev == (void *)(head)) \
|
||||
? ((head)->cqh_last) \
|
||||
: (elm->field.cqe_prev))
|
||||
|
||||
#endif /* sys/queue.h */
|
||||
158
tasks/libposix/include/posix/sys/quota.h
Normal file
158
tasks/libposix/include/posix/sys/quota.h
Normal file
@@ -0,0 +1,158 @@
|
||||
/* This just represents the non-kernel parts of <linux/quota.h>.
|
||||
*
|
||||
* here's the corresponding copyright:
|
||||
* Copyright (c) 1982, 1986 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Robert Elz at The University of Melbourne.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* Version: $Id: quota.h,v 1.1 2002/01/03 04:00:09 andersen Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_QUOTA_H
|
||||
#define _SYS_QUOTA_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* Convert diskblocks to blocks and the other way around.
|
||||
* currently only to fool the BSD source. :-)
|
||||
*/
|
||||
#define dbtob(num) ((num) << 10)
|
||||
#define btodb(num) ((num) >> 10)
|
||||
|
||||
/*
|
||||
* Convert count of filesystem blocks to diskquota blocks, meant
|
||||
* for filesystems where i_blksize != BLOCK_SIZE
|
||||
*/
|
||||
#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / BLOCK_SIZE)
|
||||
|
||||
/*
|
||||
* Definitions for disk quotas imposed on the average user
|
||||
* (big brother finally hits Linux).
|
||||
*
|
||||
* The following constants define the amount of time given a user
|
||||
* before the soft limits are treated as hard limits (usually resulting
|
||||
* in an allocation failure). The timer is started when the user crosses
|
||||
* their soft limit, it is reset when they go below their soft limit.
|
||||
*/
|
||||
#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */
|
||||
#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */
|
||||
|
||||
#define MAXQUOTAS 2
|
||||
#define USRQUOTA 0 /* element used for user quotas */
|
||||
#define GRPQUOTA 1 /* element used for group quotas */
|
||||
|
||||
/*
|
||||
* Definitions for the default names of the quotas files.
|
||||
*/
|
||||
#define INITQFNAMES { \
|
||||
"user", /* USRQUOTA */ \
|
||||
"group", /* GRPQUOTA */ \
|
||||
"undefined", \
|
||||
};
|
||||
|
||||
#define QUOTAFILENAME "quota"
|
||||
#define QUOTAGROUP "staff"
|
||||
|
||||
#define NR_DQHASH 43 /* Just an arbitrary number any suggestions ? */
|
||||
#define NR_DQUOTS 256 /* Number of quotas active at one time */
|
||||
|
||||
/*
|
||||
* Command definitions for the 'quotactl' system call.
|
||||
* The commands are broken into a main command defined below
|
||||
* and a subcommand that is used to convey the type of
|
||||
* quota that is being manipulated (see above).
|
||||
*/
|
||||
#define SUBCMDMASK 0x00ff
|
||||
#define SUBCMDSHIFT 8
|
||||
#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
|
||||
|
||||
#define Q_QUOTAON 0x0100 /* enable quotas */
|
||||
#define Q_QUOTAOFF 0x0200 /* disable quotas */
|
||||
#define Q_GETQUOTA 0x0300 /* get limits and usage */
|
||||
#define Q_SETQUOTA 0x0400 /* set limits and usage */
|
||||
#define Q_SETUSE 0x0500 /* set usage */
|
||||
#define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
|
||||
#define Q_SETQLIM 0x0700 /* set limits */
|
||||
#define Q_GETSTATS 0x0800 /* get collected stats */
|
||||
#define Q_RSQUASH 0x1000 /* set root_squash option */
|
||||
|
||||
/*
|
||||
* The following structure defines the format of the disk quota file
|
||||
* (as it appears on disk) - the file is an array of these structures
|
||||
* indexed by user or group number.
|
||||
*/
|
||||
struct dqblk
|
||||
{
|
||||
u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
|
||||
u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
|
||||
u_int32_t dqb_curblocks; /* current block count */
|
||||
u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */
|
||||
u_int32_t dqb_isoftlimit; /* preferred inode limit */
|
||||
u_int32_t dqb_curinodes; /* current # allocated inodes */
|
||||
time_t dqb_btime; /* time limit for excessive disk use */
|
||||
time_t dqb_itime; /* time limit for excessive files */
|
||||
};
|
||||
|
||||
/*
|
||||
* Shorthand notation.
|
||||
*/
|
||||
#define dq_bhardlimit dq_dqb.dqb_bhardlimit
|
||||
#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
|
||||
#define dq_curblocks dq_dqb.dqb_curblocks
|
||||
#define dq_ihardlimit dq_dqb.dqb_ihardlimit
|
||||
#define dq_isoftlimit dq_dqb.dqb_isoftlimit
|
||||
#define dq_curinodes dq_dqb.dqb_curinodes
|
||||
#define dq_btime dq_dqb.dqb_btime
|
||||
#define dq_itime dq_dqb.dqb_itime
|
||||
|
||||
#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk)))
|
||||
|
||||
struct dqstats
|
||||
{
|
||||
u_int32_t lookups;
|
||||
u_int32_t drops;
|
||||
u_int32_t reads;
|
||||
u_int32_t writes;
|
||||
u_int32_t cache_hits;
|
||||
u_int32_t pages_allocated;
|
||||
u_int32_t allocated_dquots;
|
||||
u_int32_t free_dquots;
|
||||
u_int32_t syncs;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int quotactl (int __cmd, const char *__special, int __id,
|
||||
caddr_t __addr) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/quota.h */
|
||||
49
tasks/libposix/include/posix/sys/reboot.h
Normal file
49
tasks/libposix/include/posix/sys/reboot.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* This file should define RB_* macros to be used as flag
|
||||
bits in the argument to the `reboot' system call. */
|
||||
|
||||
#ifndef _SYS_REBOOT_H
|
||||
#define _SYS_REBOOT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Perform a hard reset now. */
|
||||
#define RB_AUTOBOOT 0x01234567
|
||||
|
||||
/* Halt the system. */
|
||||
#define RB_HALT_SYSTEM 0xcdef0123
|
||||
|
||||
/* Enable reboot using Ctrl-Alt-Delete keystroke. */
|
||||
#define RB_ENABLE_CAD 0x89abcdef
|
||||
|
||||
/* Disable reboot using Ctrl-Alt-Delete keystroke. */
|
||||
#define RB_DISABLE_CAD 0
|
||||
|
||||
/* Stop system and switch power off if possible. */
|
||||
#define RB_POWER_OFF 0x4321fedc
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Reboot or halt the system. */
|
||||
extern int reboot (int __howto) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_REBOOT_H */
|
||||
103
tasks/libposix/include/posix/sys/resource.h
Normal file
103
tasks/libposix/include/posix/sys/resource.h
Normal file
@@ -0,0 +1,103 @@
|
||||
/* Copyright (C) 1992,94,1996-2000,2002,2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_RESOURCE_H
|
||||
#define _SYS_RESOURCE_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the system-dependent definitions of structures and bit values. */
|
||||
#include <bits/resource.h>
|
||||
|
||||
#ifndef __id_t_defined
|
||||
typedef __id_t id_t;
|
||||
# define __id_t_defined
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* The X/Open standard defines that all the functions below must use
|
||||
`int' as the type for the first argument. When we are compiling with
|
||||
GNU extensions we change this slightly to provide better error
|
||||
checking. */
|
||||
#if defined __USE_GNU && !defined __cplusplus
|
||||
typedef enum __rlimit_resource __rlimit_resource_t;
|
||||
typedef enum __rusage_who __rusage_who_t;
|
||||
typedef enum __priority_which __priority_which_t;
|
||||
#else
|
||||
typedef int __rlimit_resource_t;
|
||||
typedef int __rusage_who_t;
|
||||
typedef int __priority_which_t;
|
||||
#endif
|
||||
|
||||
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
|
||||
Returns 0 if successful, -1 if not (and sets errno). */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int getrlimit (__rlimit_resource_t __resource,
|
||||
struct rlimit *__rlimits) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource,
|
||||
struct rlimit *__rlimits), getrlimit64);
|
||||
# else
|
||||
# define getrlimit getrlimit64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int getrlimit64 (__rlimit_resource_t __resource,
|
||||
struct rlimit64 *__rlimits) __THROW;
|
||||
#endif
|
||||
|
||||
/* Set the soft and hard limits for RESOURCE to *RLIMITS.
|
||||
Only the super-user can increase hard limits.
|
||||
Return 0 if successful, -1 if not (and sets errno). */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int setrlimit (__rlimit_resource_t __resource,
|
||||
__const struct rlimit *__rlimits) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource,
|
||||
__const struct rlimit *__rlimits),
|
||||
setrlimit64);
|
||||
# else
|
||||
# define setrlimit setrlimit64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int setrlimit64 (__rlimit_resource_t __resource,
|
||||
__const struct rlimit64 *__rlimits) __THROW;
|
||||
#endif
|
||||
|
||||
/* Return resource usage information on process indicated by WHO
|
||||
and put it in *USAGE. Returns 0 for success, -1 for failure. */
|
||||
extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
|
||||
|
||||
/* Return the highest priority of any process specified by WHICH and WHO
|
||||
(see above); if WHO is zero, the current process, process group, or user
|
||||
(as specified by WHO) is used. A lower priority number means higher
|
||||
priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
|
||||
extern int getpriority (__priority_which_t __which, id_t __who) __THROW;
|
||||
|
||||
/* Set the priority of all processes specified by WHICH and WHO (see above)
|
||||
to PRIO. Returns 0 on success, -1 on errors. */
|
||||
extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
|
||||
__THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/resource.h */
|
||||
130
tasks/libposix/include/posix/sys/select.h
Normal file
130
tasks/libposix/include/posix/sys/select.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/* `fd_set' type and related macros, and `select'/`pselect' declarations.
|
||||
Copyright (C) 1996,97,98,99,2000,01,02,2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h> */
|
||||
|
||||
#ifndef _SYS_SELECT_H
|
||||
#define _SYS_SELECT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get definition of needed basic types. */
|
||||
#include <bits/types.h>
|
||||
|
||||
/* Get __FD_* definitions. */
|
||||
#include <bits/select.h>
|
||||
|
||||
/* Get __sigset_t. */
|
||||
#include <bits/sigset.h>
|
||||
|
||||
#ifndef __sigset_t_defined
|
||||
# define __sigset_t_defined
|
||||
typedef __sigset_t sigset_t;
|
||||
#endif
|
||||
|
||||
/* Get definition of timer specification structures. */
|
||||
#define __need_time_t
|
||||
#define __need_timespec
|
||||
#include <time.h>
|
||||
#define __need_timeval
|
||||
#include <bits/time.h>
|
||||
|
||||
#ifndef __suseconds_t_defined
|
||||
typedef __suseconds_t suseconds_t;
|
||||
# define __suseconds_t_defined
|
||||
#endif
|
||||
|
||||
|
||||
/* The fd_set member is required to be an array of longs. */
|
||||
typedef long int __fd_mask;
|
||||
|
||||
/* Some versions of <linux/posix_types.h> define these macros. */
|
||||
#undef __NFDBITS
|
||||
#undef __FDELT
|
||||
#undef __FDMASK
|
||||
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
||||
#define __NFDBITS (8 * sizeof (__fd_mask))
|
||||
#define __FDELT(d) ((d) / __NFDBITS)
|
||||
#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
|
||||
|
||||
/* fd_set for select and pselect. */
|
||||
typedef struct
|
||||
{
|
||||
/* XPG4.2 requires this member name. Otherwise avoid the name
|
||||
from the global namespace. */
|
||||
#ifdef __USE_XOPEN
|
||||
__fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
|
||||
# define __FDS_BITS(set) ((set)->fds_bits)
|
||||
#else
|
||||
__fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
|
||||
# define __FDS_BITS(set) ((set)->__fds_bits)
|
||||
#endif
|
||||
} fd_set;
|
||||
|
||||
/* Maximum number of file descriptors in `fd_set'. */
|
||||
#define FD_SETSIZE __FD_SETSIZE
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Sometimes the fd_set member is assumed to have this type. */
|
||||
typedef __fd_mask fd_mask;
|
||||
|
||||
/* Number of bits per word of `fd_set' (some code assumes this is 32). */
|
||||
# define NFDBITS __NFDBITS
|
||||
#endif
|
||||
|
||||
|
||||
/* Access macros for `fd_set'. */
|
||||
#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
|
||||
#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
|
||||
#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
|
||||
#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
|
||||
readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
|
||||
(if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
|
||||
after waiting the interval specified therein. Returns the number of ready
|
||||
descriptors, or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int select (int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
struct timeval *__restrict __timeout);
|
||||
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* Same as above only that the TIMEOUT value is given with higher
|
||||
resolution and a sigmask which is been set temporarily. This version
|
||||
should be used.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int pselect (int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
const struct timespec *__restrict __timeout,
|
||||
const __sigset_t *__restrict __sigmask);
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/select.h */
|
||||
58
tasks/libposix/include/posix/sys/sem.h
Normal file
58
tasks/libposix/include/posix/sys/sem.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_SEM_H
|
||||
#define _SYS_SEM_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get common definition of System V style IPC. */
|
||||
#include <sys/ipc.h>
|
||||
|
||||
/* Get system dependent definition of `struct semid_ds' and more. */
|
||||
#include <bits/sem.h>
|
||||
|
||||
/* The following System V style IPC functions implement a semaphore
|
||||
handling. The definition is found in XPG2. */
|
||||
|
||||
/* Structure used for argument to `semop' to describe operations. */
|
||||
struct sembuf
|
||||
{
|
||||
unsigned short int sem_num; /* semaphore number */
|
||||
short int sem_op; /* semaphore operation */
|
||||
short int sem_flg; /* operation flag */
|
||||
};
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Semaphore control operation. */
|
||||
extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
|
||||
|
||||
/* Get semaphore. */
|
||||
extern int semget (key_t __key, int __nsems, int __semflg) __THROW;
|
||||
|
||||
/* Operate on semaphore. */
|
||||
extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sem.h */
|
||||
52
tasks/libposix/include/posix/sys/sendfile.h
Normal file
52
tasks/libposix/include/posix/sys/sendfile.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* sendfile -- copy data directly from one file descriptor to another
|
||||
Copyright (C) 1998,99,01,2002,2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_SENDFILE_H
|
||||
#define _SYS_SENDFILE_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Send up to COUNT bytes from file associated with IN_FD starting at
|
||||
*OFFSET to descriptor OUT_FD. Set *OFFSET to the IN_FD's file position
|
||||
following the read bytes. If OFFSET is a null pointer, use the normal
|
||||
file position instead. Return the number of written bytes, or -1 in
|
||||
case of error. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
|
||||
size_t __count) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern ssize_t __REDIRECT_NTH (sendfile,
|
||||
(int __out_fd, int __in_fd, __off64_t *__offset,
|
||||
size_t __count), sendfile64);
|
||||
# else
|
||||
# define sendfile sendfile64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
|
||||
size_t __count) __THROW;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sendfile.h */
|
||||
64
tasks/libposix/include/posix/sys/shm.h
Normal file
64
tasks/libposix/include/posix/sys/shm.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_SHM_H
|
||||
#define _SYS_SHM_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get common definition of System V style IPC. */
|
||||
#include <sys/ipc.h>
|
||||
|
||||
/* Get system dependent definition of `struct shmid_ds' and more. */
|
||||
#include <bits/shm.h>
|
||||
|
||||
/* Define types required by the standard. */
|
||||
#define __need_time_t
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __USE_XOPEN
|
||||
# ifndef __pid_t_defined
|
||||
typedef __pid_t pid_t;
|
||||
# define __pid_t_defined
|
||||
# endif
|
||||
#endif /* X/Open */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* The following System V style IPC functions implement a shared memory
|
||||
facility. The definition is found in XPG4.2. */
|
||||
|
||||
/* Shared memory control operation. */
|
||||
extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
|
||||
|
||||
/* Get shared memory segment. */
|
||||
extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
|
||||
|
||||
/* Attach shared memory segment. */
|
||||
extern void *shmat (int __shmid, __const void *__shmaddr, int __shmflg)
|
||||
__THROW;
|
||||
|
||||
/* Detach shared memory segment. */
|
||||
extern int shmdt (__const void *__shmaddr) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/shm.h */
|
||||
1
tasks/libposix/include/posix/sys/signal.h
Normal file
1
tasks/libposix/include/posix/sys/signal.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <signal.h>
|
||||
236
tasks/libposix/include/posix/sys/socket.h
Normal file
236
tasks/libposix/include/posix/sys/socket.h
Normal file
@@ -0,0 +1,236 @@
|
||||
/* Declarations of socket constants, types, and functions.
|
||||
Copyright (C) 1991,92,1994-2001,2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_SOCKET_H
|
||||
#define _SYS_SOCKET_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <sys/uio.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/* This operating system-specific header file defines the SOCK_*, PF_*,
|
||||
AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr',
|
||||
`struct msghdr', and `struct linger' types. */
|
||||
#include <bits/socket.h>
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* This is the 4.3 BSD `struct sockaddr' format, which is used as wire
|
||||
format in the grotty old 4.3 `talk' protocol. */
|
||||
struct osockaddr
|
||||
{
|
||||
unsigned short int sa_family;
|
||||
unsigned char sa_data[14];
|
||||
};
|
||||
#endif
|
||||
|
||||
/* The following constants should be used for the second parameter of
|
||||
`shutdown'. */
|
||||
enum
|
||||
{
|
||||
SHUT_RD = 0, /* No more receptions. */
|
||||
#define SHUT_RD SHUT_RD
|
||||
SHUT_WR, /* No more transmissions. */
|
||||
#define SHUT_WR SHUT_WR
|
||||
SHUT_RDWR /* No more receptions or transmissions. */
|
||||
#define SHUT_RDWR SHUT_RDWR
|
||||
};
|
||||
|
||||
/* This is the type we use for generic socket address arguments.
|
||||
|
||||
With GCC 2.7 and later, the funky union causes redeclarations or
|
||||
uses with any of the listed types to be allowed without complaint.
|
||||
G++ 2.7 does not support transparent unions so there we want the
|
||||
old-style declaration, too. */
|
||||
#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU
|
||||
# define __SOCKADDR_ARG struct sockaddr *__restrict
|
||||
# define __CONST_SOCKADDR_ARG __const struct sockaddr *
|
||||
#else
|
||||
/* Add more `struct sockaddr_AF' types here as necessary.
|
||||
These are all the ones I found on NetBSD and Linux. */
|
||||
# define __SOCKADDR_ALLTYPES \
|
||||
__SOCKADDR_ONETYPE (sockaddr) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_at) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_ax25) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_dl) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_eon) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_in) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_in6) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_inarp) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_ipx) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_iso) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_ns) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_un) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_x25)
|
||||
|
||||
# define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__;
|
||||
typedef union { __SOCKADDR_ALLTYPES
|
||||
} __SOCKADDR_ARG __attribute__ ((__transparent_union__));
|
||||
# undef __SOCKADDR_ONETYPE
|
||||
# define __SOCKADDR_ONETYPE(type) __const struct type *__restrict __##type##__;
|
||||
typedef union { __SOCKADDR_ALLTYPES
|
||||
} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
|
||||
# undef __SOCKADDR_ONETYPE
|
||||
#endif
|
||||
|
||||
|
||||
/* Create a new socket of type TYPE in domain DOMAIN, using
|
||||
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
|
||||
Returns a file descriptor for the new socket, or -1 for errors. */
|
||||
extern int socket (int __domain, int __type, int __protocol) __THROW;
|
||||
|
||||
/* Create two new sockets, of type TYPE in domain DOMAIN and using
|
||||
protocol PROTOCOL, which are connected to each other, and put file
|
||||
descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
|
||||
one will be chosen automatically. Returns 0 on success, -1 for errors. */
|
||||
extern int socketpair (int __domain, int __type, int __protocol,
|
||||
int __fds[2]) __THROW;
|
||||
|
||||
/* Give the socket FD the local address ADDR (which is LEN bytes long). */
|
||||
extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
|
||||
__THROW;
|
||||
|
||||
/* Put the local address of FD into *ADDR and its length in *LEN. */
|
||||
extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __len) __THROW;
|
||||
|
||||
/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
|
||||
For connectionless socket types, just set the default address to send to
|
||||
and the only address from which to accept transmissions.
|
||||
Return 0 on success, -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
|
||||
|
||||
/* Put the address of the peer connected to socket FD into *ADDR
|
||||
(which is *LEN bytes long), and its actual length into *LEN. */
|
||||
extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __len) __THROW;
|
||||
|
||||
|
||||
/* Send N bytes of BUF to socket FD. Returns the number sent or -1.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags);
|
||||
|
||||
/* Read N bytes into BUF from socket FD.
|
||||
Returns the number read or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags);
|
||||
|
||||
/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
|
||||
ADDR_LEN bytes long). Returns the number sent, or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
|
||||
int __flags, __CONST_SOCKADDR_ARG __addr,
|
||||
socklen_t __addr_len);
|
||||
|
||||
/* Read N bytes into BUF through socket FD.
|
||||
If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
|
||||
the sender, and store the actual size of the address in *ADDR_LEN.
|
||||
Returns the number of bytes read or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
|
||||
int __flags, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __addr_len);
|
||||
|
||||
|
||||
/* Send a message described MESSAGE on socket FD.
|
||||
Returns the number of bytes sent, or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t sendmsg (int __fd, __const struct msghdr *__message,
|
||||
int __flags);
|
||||
|
||||
/* Receive a message as described by MESSAGE from socket FD.
|
||||
Returns the number of bytes read or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
|
||||
|
||||
|
||||
/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
|
||||
into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
|
||||
actual length. Returns 0 on success, -1 for errors. */
|
||||
extern int getsockopt (int __fd, int __level, int __optname,
|
||||
void *__restrict __optval,
|
||||
socklen_t *__restrict __optlen) __THROW;
|
||||
|
||||
/* Set socket FD's option OPTNAME at protocol level LEVEL
|
||||
to *OPTVAL (which is OPTLEN bytes long).
|
||||
Returns 0 on success, -1 for errors. */
|
||||
extern int setsockopt (int __fd, int __level, int __optname,
|
||||
__const void *__optval, socklen_t __optlen) __THROW;
|
||||
|
||||
|
||||
/* Prepare to accept connections on socket FD.
|
||||
N connection requests will be queued before further requests are refused.
|
||||
Returns 0 on success, -1 for errors. */
|
||||
extern int listen (int __fd, int __n) __THROW;
|
||||
|
||||
/* Await a connection on socket FD.
|
||||
When a connection arrives, open a new socket to communicate with it,
|
||||
set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
|
||||
peer and *ADDR_LEN to the address's actual length, and return the
|
||||
new socket's descriptor, or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int accept (int __fd, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __addr_len);
|
||||
|
||||
/* Shut down all or part of the connection open on socket FD.
|
||||
HOW determines what to shut down:
|
||||
SHUT_RD = No more receptions;
|
||||
SHUT_WR = No more transmissions;
|
||||
SHUT_RDWR = No more receptions or transmissions.
|
||||
Returns 0 on success, -1 for errors. */
|
||||
extern int shutdown (int __fd, int __how) __THROW;
|
||||
|
||||
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* Determine wheter socket is at a out-of-band mark. */
|
||||
extern int sockatmark (int __fd) __THROW;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* FDTYPE is S_IFSOCK or another S_IF* macro defined in <sys/stat.h>;
|
||||
returns 1 if FD is open on an object of the indicated type, 0 if not,
|
||||
or -1 for errors (setting errno). */
|
||||
extern int isfdtype (int __fd, int __fdtype) __THROW;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/socket.h */
|
||||
3
tasks/libposix/include/posix/sys/socketvar.h
Normal file
3
tasks/libposix/include/posix/sys/socketvar.h
Normal file
@@ -0,0 +1,3 @@
|
||||
/* This header is used on many systems but for GNU we have everything
|
||||
already defined in the standard header. */
|
||||
#include <sys/socket.h>
|
||||
1
tasks/libposix/include/posix/sys/soundcard.h
Normal file
1
tasks/libposix/include/posix/sys/soundcard.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <linux/soundcard.h>
|
||||
366
tasks/libposix/include/posix/sys/stat.h
Normal file
366
tasks/libposix/include/posix/sys/stat.h
Normal file
@@ -0,0 +1,366 @@
|
||||
/* Copyright (C) 1991,1992,1995-2004,2005,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 5.6 File Characteristics <sys/stat.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_STAT_H
|
||||
#define _SYS_STAT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types.h> /* For __mode_t and __dev_t. */
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_MISC
|
||||
# if defined __USE_XOPEN || defined __USE_XOPEN2K
|
||||
# define __need_time_t
|
||||
# endif
|
||||
# ifdef __USE_MISC
|
||||
# define __need_timespec
|
||||
# endif
|
||||
# include <time.h> /* For time_t resp. timespec. */
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_XOPEN2K
|
||||
/* The Single Unix specification says that some more types are
|
||||
available here. */
|
||||
# ifndef __dev_t_defined
|
||||
typedef __dev_t dev_t;
|
||||
# define __dev_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __gid_t_defined
|
||||
typedef __gid_t gid_t;
|
||||
# define __gid_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __ino_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __ino_t ino_t;
|
||||
# else
|
||||
typedef __ino64_t ino_t;
|
||||
# endif
|
||||
# define __ino_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __mode_t_defined
|
||||
typedef __mode_t mode_t;
|
||||
# define __mode_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __nlink_t_defined
|
||||
typedef __nlink_t nlink_t;
|
||||
# define __nlink_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __off_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __off_t off_t;
|
||||
# else
|
||||
typedef __off64_t off_t;
|
||||
# endif
|
||||
# define __off_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __uid_t_defined
|
||||
typedef __uid_t uid_t;
|
||||
# define __uid_t_defined
|
||||
# endif
|
||||
#endif /* X/Open */
|
||||
|
||||
#ifdef __USE_UNIX98
|
||||
# ifndef __blkcnt_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __blkcnt_t blkcnt_t;
|
||||
# else
|
||||
typedef __blkcnt64_t blkcnt_t;
|
||||
# endif
|
||||
# define __blkcnt_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __blksize_t_defined
|
||||
typedef __blksize_t blksize_t;
|
||||
# define __blksize_t_defined
|
||||
# endif
|
||||
#endif /* Unix98 */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/stat.h>
|
||||
|
||||
#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
|
||||
# define S_IFMT __S_IFMT
|
||||
# define S_IFDIR __S_IFDIR
|
||||
# define S_IFCHR __S_IFCHR
|
||||
# define S_IFBLK __S_IFBLK
|
||||
# define S_IFREG __S_IFREG
|
||||
# ifdef __S_IFIFO
|
||||
# define S_IFIFO __S_IFIFO
|
||||
# endif
|
||||
# ifdef __S_IFLNK
|
||||
# define S_IFLNK __S_IFLNK
|
||||
# endif
|
||||
# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98) \
|
||||
&& defined __S_IFSOCK
|
||||
# define S_IFSOCK __S_IFSOCK
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Test macros for file types. */
|
||||
|
||||
#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
|
||||
|
||||
#define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
|
||||
#define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR)
|
||||
#define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK)
|
||||
#define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG)
|
||||
#ifdef __S_IFIFO
|
||||
# define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO)
|
||||
#endif
|
||||
#ifdef __S_IFLNK
|
||||
# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
|
||||
#endif
|
||||
|
||||
#if defined __USE_BSD && !defined __S_IFLNK
|
||||
# define S_ISLNK(mode) 0
|
||||
#endif
|
||||
|
||||
#if (defined __USE_BSD || defined __USE_UNIX98) \
|
||||
&& defined __S_IFSOCK
|
||||
# define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
|
||||
#endif
|
||||
|
||||
/* These are from POSIX.1b. If the objects are not implemented using separate
|
||||
distinct file types, the macros always will evaluate to zero. Unlike the
|
||||
other S_* macros the following three take a pointer to a `struct stat'
|
||||
object as the argument. */
|
||||
#ifdef __USE_POSIX199309
|
||||
# define S_TYPEISMQ(buf) __S_TYPEISMQ(buf)
|
||||
# define S_TYPEISSEM(buf) __S_TYPEISSEM(buf)
|
||||
# define S_TYPEISSHM(buf) __S_TYPEISSHM(buf)
|
||||
#endif
|
||||
|
||||
|
||||
/* Protection bits. */
|
||||
|
||||
#define S_ISUID __S_ISUID /* Set user ID on execution. */
|
||||
#define S_ISGID __S_ISGID /* Set group ID on execution. */
|
||||
|
||||
#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
|
||||
/* Save swapped text after use (sticky bit). This is pretty well obsolete. */
|
||||
# define S_ISVTX __S_ISVTX
|
||||
#endif
|
||||
|
||||
#define S_IRUSR __S_IREAD /* Read by owner. */
|
||||
#define S_IWUSR __S_IWRITE /* Write by owner. */
|
||||
#define S_IXUSR __S_IEXEC /* Execute by owner. */
|
||||
/* Read, write, and execute by owner. */
|
||||
#define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC)
|
||||
|
||||
#if defined __USE_MISC && defined __USE_BSD
|
||||
# define S_IREAD S_IRUSR
|
||||
# define S_IWRITE S_IWUSR
|
||||
# define S_IEXEC S_IXUSR
|
||||
#endif
|
||||
|
||||
#define S_IRGRP (S_IRUSR >> 3) /* Read by group. */
|
||||
#define S_IWGRP (S_IWUSR >> 3) /* Write by group. */
|
||||
#define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */
|
||||
/* Read, write, and execute by group. */
|
||||
#define S_IRWXG (S_IRWXU >> 3)
|
||||
|
||||
#define S_IROTH (S_IRGRP >> 3) /* Read by others. */
|
||||
#define S_IWOTH (S_IWGRP >> 3) /* Write by others. */
|
||||
#define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */
|
||||
/* Read, write, and execute by others. */
|
||||
#define S_IRWXO (S_IRWXG >> 3)
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Macros for common mode bit masks. */
|
||||
# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
|
||||
# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
|
||||
# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
|
||||
|
||||
# define S_BLKSIZE 512 /* Block size for `st_blocks'. */
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
/* Get file attributes for FILE and put them in BUF. */
|
||||
extern int stat (__const char *__restrict __file,
|
||||
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
|
||||
|
||||
/* Get file attributes for the file, device, pipe, or socket
|
||||
that file descriptor FD is open on and put them in BUF. */
|
||||
extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (stat, (__const char *__restrict __file,
|
||||
struct stat *__restrict __buf), stat64)
|
||||
__nonnull ((1, 2));
|
||||
extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
|
||||
__nonnull ((2));
|
||||
# else
|
||||
# define stat stat64
|
||||
# define fstat fstat64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int stat64 (__const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
|
||||
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Similar to stat, get the attributes for FILE and put them in BUF.
|
||||
Relative path names are interpreted relative to FD unless FD is
|
||||
AT_FDCWD. */
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int fstatat (int __fd, __const char *__restrict __file,
|
||||
struct stat *__restrict __buf, int __flag)
|
||||
__THROW __nonnull ((2, 3));
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__restrict __file,
|
||||
struct stat *__restrict __buf,
|
||||
int __flag),
|
||||
fstatat64) __nonnull ((2, 3));
|
||||
# else
|
||||
# define fstatat fstatat64
|
||||
# endif
|
||||
# endif
|
||||
|
||||
extern int fstatat64 (int __fd, __const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf, int __flag)
|
||||
__THROW __nonnull ((2, 3));
|
||||
#endif
|
||||
|
||||
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
/* Get file attributes about FILE and put them in BUF.
|
||||
If FILE is a symbolic link, do not follow it. */
|
||||
extern int lstat (__const char *__restrict __file,
|
||||
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (lstat,
|
||||
(__const char *__restrict __file,
|
||||
struct stat *__restrict __buf), lstat64)
|
||||
__nonnull ((1, 2));
|
||||
# else
|
||||
# define lstat lstat64
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int lstat64 (__const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Set file access permissions for FILE to MODE.
|
||||
If FILE is a symbolic link, this affects its target instead. */
|
||||
extern int chmod (__const char *__file, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#if 0 /*def __USE_BSD*/
|
||||
/* Set file access permissions for FILE to MODE.
|
||||
If FILE is a symbolic link, this affects the link itself
|
||||
rather than its target. */
|
||||
extern int lchmod (__const char *__file, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
#endif
|
||||
|
||||
/* Set file access permissions of the file FD is open on to MODE. */
|
||||
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
extern int fchmod (int __fd, __mode_t __mode) __THROW;
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Set file access permissions of FILE relative to
|
||||
the directory FD is open on. */
|
||||
extern int fchmodat (int __fd, __const char *__file, __mode_t mode, int __flag)
|
||||
__THROW __nonnull ((2)) __wur;
|
||||
#endif /* Use ATFILE. */
|
||||
|
||||
|
||||
|
||||
/* Set the file creation mask of the current process to MASK,
|
||||
and return the old creation mask. */
|
||||
extern __mode_t umask (__mode_t __mask) __THROW;
|
||||
|
||||
#if 0 /*def __USE_GNU*/
|
||||
/* Get the current `umask' value without changing it.
|
||||
This function is only available under the GNU Hurd. */
|
||||
extern __mode_t getumask (void) __THROW;
|
||||
#endif
|
||||
|
||||
/* Create a new directory named PATH, with permission bits MODE. */
|
||||
extern int mkdir (__const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Like mkdir, create a new directory with permission bits MODE. But
|
||||
interpret relative PATH names relative to the directory associated
|
||||
with FD. */
|
||||
extern int mkdirat (int __fd, __const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
/* Create a device file named PATH, with permission and special bits MODE
|
||||
and device number DEV (which can be constructed from major and minor
|
||||
device numbers with the `makedev' macro above). */
|
||||
#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
|
||||
__THROW __nonnull ((1));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Like mknod, create a new device file with permission bits MODE and
|
||||
device number DEV. But interpret relative PATH names relative to
|
||||
the directory associated with FD. */
|
||||
extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
|
||||
__dev_t __dev) __THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
|
||||
/* Create a new FIFO named PATH, with permission bits MODE. */
|
||||
extern int mkfifo (__const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Like mkfifo, create a new FIFO with permission bits MODE. But
|
||||
interpret relative PATH names relative to the directory associated
|
||||
with FD. */
|
||||
extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
/* on uClibc we have unversioned struct stat and mknod.
|
||||
* bits/stat.h is filled with wrong info, so we undo it here. */
|
||||
#undef _STAT_VER
|
||||
#define _STAT_VER 0
|
||||
#undef _MKNOD_VER
|
||||
#define _MKNOD_VER 0
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif /* sys/stat.h */
|
||||
68
tasks/libposix/include/posix/sys/statfs.h
Normal file
68
tasks/libposix/include/posix/sys/statfs.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* Definitions for getting information about a filesystem.
|
||||
Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_STATFS_H
|
||||
#define _SYS_STATFS_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the system-specific definition of `struct statfs'. */
|
||||
#include <bits/statfs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return information about the filesystem on which FILE resides. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int statfs (__const char *__file, struct statfs *__buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (statfs,
|
||||
(__const char *__file, struct statfs *__buf),
|
||||
statfs64) __nonnull ((1, 2));
|
||||
# else
|
||||
# define statfs statfs64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int statfs64 (__const char *__file, struct statfs64 *__buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
#endif
|
||||
|
||||
/* Return information about the filesystem containing the file FILDES
|
||||
refers to. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int fstatfs (int __fildes, struct statfs *__buf)
|
||||
__THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
|
||||
fstatfs64) __nonnull ((2));
|
||||
# else
|
||||
# define fstatfs fstatfs64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int fstatfs64 (int __fildes, struct statfs64 *__buf)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/statfs.h */
|
||||
91
tasks/libposix/include/posix/sys/statvfs.h
Normal file
91
tasks/libposix/include/posix/sys/statvfs.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/* Definitions for getting information about a filesystem.
|
||||
Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_STATVFS_H
|
||||
#define _SYS_STATVFS_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the system-specific definition of `struct statfs'. */
|
||||
#include <bits/statvfs.h>
|
||||
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
# ifndef __fsblkcnt_t_defined
|
||||
typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
|
||||
# define __fsblkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsfilcnt_t_defined
|
||||
typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
|
||||
# define __fsfilcnt_t_defined
|
||||
# endif
|
||||
#else
|
||||
# ifndef __fsblkcnt_t_defined
|
||||
typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
|
||||
# define __fsblkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsfilcnt_t_defined
|
||||
typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
|
||||
# define __fsfilcnt_t_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return information about the filesystem on which FILE resides. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int statvfs (__const char *__restrict __file,
|
||||
struct statvfs *__restrict __buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (statvfs,
|
||||
(__const char *__restrict __file,
|
||||
struct statvfs *__restrict __buf), statvfs64)
|
||||
__nonnull ((1, 2));
|
||||
# else
|
||||
# define statvfs statvfs64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int statvfs64 (__const char *__restrict __file,
|
||||
struct statvfs64 *__restrict __buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
#endif
|
||||
|
||||
/* Return information about the filesystem containing the file FILDES
|
||||
refers to. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int fstatvfs (int __fildes, struct statvfs *__buf)
|
||||
__THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (fstatvfs, (int __fildes, struct statvfs *__buf),
|
||||
fstatvfs64) __nonnull ((2));
|
||||
# else
|
||||
# define fstatvfs fstatvfs64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/statvfs.h */
|
||||
43
tasks/libposix/include/posix/sys/swap.h
Normal file
43
tasks/libposix/include/posix/sys/swap.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* Calls to enable and disable swapping on specified locations. Linux version.
|
||||
Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_SWAP_H
|
||||
|
||||
#define _SYS_SWAP_H 1
|
||||
#include <features.h>
|
||||
|
||||
/* The swap priority is encoded as:
|
||||
(prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK
|
||||
*/
|
||||
#define SWAP_FLAG_PREFER 0x8000 /* Set if swap priority is specified. */
|
||||
#define SWAP_FLAG_PRIO_MASK 0x7fff
|
||||
#define SWAP_FLAG_PRIO_SHIFT 0
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Make the block special device PATH available to the system for swapping.
|
||||
This call is restricted to the super-user. */
|
||||
extern int swapon (__const char *__path, int __flags) __THROW;
|
||||
|
||||
/* Stop using block special device PATH for swapping. */
|
||||
extern int swapoff (__const char *__path) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_SWAP_H */
|
||||
37
tasks/libposix/include/posix/sys/syscall.h
Normal file
37
tasks/libposix/include/posix/sys/syscall.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYSCALL_H
|
||||
#define _SYSCALL_H 1
|
||||
|
||||
/* The _syscall#() macros are for uClibc internal use only.
|
||||
* User application code should use syscall() instead.
|
||||
*
|
||||
* The kernel provided _syscall[0-6] macros from asm/unistd.h are not suitable
|
||||
* for use in uClibc as they lack PIC support etc, so for uClibc we use our own
|
||||
* local _syscall# macros to be certain all such variations are handled
|
||||
* properly.
|
||||
*/
|
||||
|
||||
#include <features.h>
|
||||
#include <bits/sysnum.h>
|
||||
#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
|
||||
# include <bits/syscalls.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
72
tasks/libposix/include/posix/sys/sysctl.h
Normal file
72
tasks/libposix/include/posix/sys/sysctl.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* Copyright (C) 1996, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_SYSCTL_H
|
||||
#define _SYS_SYSCTL_H 1
|
||||
|
||||
#include <features.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
/* Prevent more kernel headers than necessary to be included. */
|
||||
#ifndef _LINUX_KERNEL_H
|
||||
# define _LINUX_KERNEL_H 1
|
||||
# define __undef_LINUX_KERNEL_H
|
||||
#endif
|
||||
#ifndef _LINUX_TYPES_H
|
||||
# define _LINUX_TYPES_H 1
|
||||
# define __undef_LINUX_TYPES_H
|
||||
#endif
|
||||
#ifndef _LINUX_LIST_H
|
||||
# define _LINUX_LIST_H 1
|
||||
# define __undef_LINUX_LIST_H
|
||||
#endif
|
||||
#ifndef __LINUX_COMPILER_H
|
||||
# define __LINUX_COMPILER_H 1
|
||||
# define __user
|
||||
# define __undef__LINUX_COMPILER_H
|
||||
#endif
|
||||
|
||||
#include <linux/sysctl.h>
|
||||
|
||||
#ifdef __undef_LINUX_KERNEL_H
|
||||
# undef _LINUX_KERNEL_H
|
||||
# undef __undef_LINUX_KERNEL_H
|
||||
#endif
|
||||
#ifdef __undef_LINUX_TYPES_H
|
||||
# undef _LINUX_TYPES_H
|
||||
# undef __undef_LINUX_TYPES_H
|
||||
#endif
|
||||
#ifdef __undef_LINUX_LIST_H
|
||||
# undef _LINUX_LIST_H
|
||||
# undef __undef_LINUX_LIST_H
|
||||
#endif
|
||||
#ifdef __undef__LINUX_COMPILER_H
|
||||
# undef __LINUX_COMPILER_H
|
||||
# undef __user
|
||||
# undef __undef__LINUX_COMPILER_H
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Read or write system parameters. */
|
||||
extern int sysctl (int *__name, int __nlen, void *__oldval,
|
||||
size_t *__oldlenp, void *__newval, size_t __newlen) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_SYSCTL_H */
|
||||
67
tasks/libposix/include/posix/sys/sysinfo.h
Normal file
67
tasks/libposix/include/posix/sys/sysinfo.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/* Copyright (C) 1996, 1999, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_SYSINFO_H
|
||||
#define _SYS_SYSINFO_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#ifndef _LINUX_KERNEL_H
|
||||
/* Include our own copy of struct sysinfo to avoid binary compatability
|
||||
* problems with Linux 2.4, which changed things. Grumble, grumble. */
|
||||
#define SI_LOAD_SHIFT 16
|
||||
struct sysinfo {
|
||||
long uptime; /* Seconds since boot */
|
||||
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
|
||||
unsigned long totalram; /* Total usable main memory size */
|
||||
unsigned long freeram; /* Available memory size */
|
||||
unsigned long sharedram; /* Amount of shared memory */
|
||||
unsigned long bufferram; /* Memory used by buffers */
|
||||
unsigned long totalswap; /* Total swap space size */
|
||||
unsigned long freeswap; /* swap space still available */
|
||||
unsigned short procs; /* Number of current processes */
|
||||
unsigned short pad; /* Padding needed for m68k */
|
||||
unsigned long totalhigh; /* Total high memory size */
|
||||
unsigned long freehigh; /* Available high memory size */
|
||||
unsigned int mem_unit; /* Memory unit size in bytes */
|
||||
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
|
||||
};
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Returns information on overall system statistics. */
|
||||
extern int sysinfo (struct sysinfo *__info) __THROW;
|
||||
|
||||
|
||||
/* Return number of configured processors. */
|
||||
extern int get_nprocs_conf (void) __THROW;
|
||||
|
||||
/* Return number of available processors. */
|
||||
extern int get_nprocs (void) __THROW;
|
||||
|
||||
|
||||
/* Return number of physical pages of memory in the system. */
|
||||
extern long int get_phys_pages (void) __THROW;
|
||||
|
||||
/* Return number of available physical pages of memory in the system. */
|
||||
extern long int get_avphys_pages (void) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sysinfo.h */
|
||||
206
tasks/libposix/include/posix/sys/syslog.h
Normal file
206
tasks/libposix/include/posix/sys/syslog.h
Normal file
@@ -0,0 +1,206 @@
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)syslog.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _SYS_SYSLOG_H
|
||||
#define _SYS_SYSLOG_H 1
|
||||
|
||||
#include <features.h>
|
||||
#define __need___va_list
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
#define _PATH_LOG "/dev/log"
|
||||
|
||||
/*
|
||||
* priorities/facilities are encoded into a single 32-bit quantity, where the
|
||||
* bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
|
||||
* (0-big number). Both the priorities and the facilities map roughly
|
||||
* one-to-one to strings in the syslogd(8) source code. This mapping is
|
||||
* included in this file.
|
||||
*
|
||||
* priorities (these are ordered)
|
||||
*/
|
||||
#define LOG_EMERG 0 /* system is unusable */
|
||||
#define LOG_ALERT 1 /* action must be taken immediately */
|
||||
#define LOG_CRIT 2 /* critical conditions */
|
||||
#define LOG_ERR 3 /* error conditions */
|
||||
#define LOG_WARNING 4 /* warning conditions */
|
||||
#define LOG_NOTICE 5 /* normal but significant condition */
|
||||
#define LOG_INFO 6 /* informational */
|
||||
#define LOG_DEBUG 7 /* debug-level messages */
|
||||
|
||||
#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
|
||||
/* extract priority */
|
||||
#define LOG_PRI(p) ((p) & LOG_PRIMASK)
|
||||
#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
|
||||
|
||||
#ifdef SYSLOG_NAMES
|
||||
#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
|
||||
/* mark "facility" */
|
||||
#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
|
||||
typedef struct _code {
|
||||
char *c_name;
|
||||
int c_val;
|
||||
} CODE;
|
||||
|
||||
CODE prioritynames[] =
|
||||
{
|
||||
{ "alert", LOG_ALERT },
|
||||
{ "crit", LOG_CRIT },
|
||||
{ "debug", LOG_DEBUG },
|
||||
{ "emerg", LOG_EMERG },
|
||||
{ "err", LOG_ERR },
|
||||
{ "error", LOG_ERR }, /* DEPRECATED */
|
||||
{ "info", LOG_INFO },
|
||||
{ "none", INTERNAL_NOPRI }, /* INTERNAL */
|
||||
{ "notice", LOG_NOTICE },
|
||||
{ "panic", LOG_EMERG }, /* DEPRECATED */
|
||||
{ "warn", LOG_WARNING }, /* DEPRECATED */
|
||||
{ "warning", LOG_WARNING },
|
||||
{ NULL, -1 }
|
||||
};
|
||||
#endif
|
||||
|
||||
/* facility codes */
|
||||
#define LOG_KERN (0<<3) /* kernel messages */
|
||||
#define LOG_USER (1<<3) /* random user-level messages */
|
||||
#define LOG_MAIL (2<<3) /* mail system */
|
||||
#define LOG_DAEMON (3<<3) /* system daemons */
|
||||
#define LOG_AUTH (4<<3) /* security/authorization messages */
|
||||
#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
|
||||
#define LOG_LPR (6<<3) /* line printer subsystem */
|
||||
#define LOG_NEWS (7<<3) /* network news subsystem */
|
||||
#define LOG_UUCP (8<<3) /* UUCP subsystem */
|
||||
#define LOG_CRON (9<<3) /* clock daemon */
|
||||
#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
|
||||
#define LOG_FTP (11<<3) /* ftp daemon */
|
||||
|
||||
/* other codes through 15 reserved for system use */
|
||||
#define LOG_LOCAL0 (16<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL1 (17<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL2 (18<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL3 (19<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL4 (20<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL5 (21<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL6 (22<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL7 (23<<3) /* reserved for local use */
|
||||
|
||||
#define LOG_NFACILITIES 24 /* current number of facilities */
|
||||
#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
|
||||
/* facility of pri */
|
||||
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
|
||||
|
||||
#ifdef SYSLOG_NAMES
|
||||
CODE facilitynames[] =
|
||||
{
|
||||
{ "auth", LOG_AUTH },
|
||||
{ "authpriv", LOG_AUTHPRIV },
|
||||
{ "cron", LOG_CRON },
|
||||
{ "daemon", LOG_DAEMON },
|
||||
{ "ftp", LOG_FTP },
|
||||
{ "kern", LOG_KERN },
|
||||
{ "lpr", LOG_LPR },
|
||||
{ "mail", LOG_MAIL },
|
||||
{ "mark", INTERNAL_MARK }, /* INTERNAL */
|
||||
{ "news", LOG_NEWS },
|
||||
{ "security", LOG_AUTH }, /* DEPRECATED */
|
||||
{ "syslog", LOG_SYSLOG },
|
||||
{ "user", LOG_USER },
|
||||
{ "uucp", LOG_UUCP },
|
||||
{ "local0", LOG_LOCAL0 },
|
||||
{ "local1", LOG_LOCAL1 },
|
||||
{ "local2", LOG_LOCAL2 },
|
||||
{ "local3", LOG_LOCAL3 },
|
||||
{ "local4", LOG_LOCAL4 },
|
||||
{ "local5", LOG_LOCAL5 },
|
||||
{ "local6", LOG_LOCAL6 },
|
||||
{ "local7", LOG_LOCAL7 },
|
||||
{ NULL, -1 }
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* arguments to setlogmask.
|
||||
*/
|
||||
#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
|
||||
#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
|
||||
|
||||
/*
|
||||
* Option flags for openlog.
|
||||
*
|
||||
* LOG_ODELAY no longer does anything.
|
||||
* LOG_NDELAY is the inverse of what it used to be.
|
||||
*/
|
||||
#define LOG_PID 0x01 /* log the pid with each message */
|
||||
#define LOG_CONS 0x02 /* log on the console if errors in sending */
|
||||
#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
|
||||
#define LOG_NDELAY 0x08 /* don't delay open */
|
||||
#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
|
||||
#define LOG_PERROR 0x20 /* log to stderr as well */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Close descriptor used to write to system logger.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern void closelog (void);
|
||||
|
||||
/* Open connection to system logger.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern void openlog (__const char *__ident, int __option, int __facility);
|
||||
|
||||
/* Set the log mask level. */
|
||||
extern int setlogmask (int __mask) __THROW;
|
||||
|
||||
/* Generate a log message using FMT string and option arguments.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern void syslog (int __pri, __const char *__fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Generate a log message using FMT and using arguments pointed to by AP.
|
||||
|
||||
This function is not part of POSIX and therefore no official
|
||||
cancellation point. But due to similarity with an POSIX interface
|
||||
or due to the implementation it is a cancellation point and
|
||||
therefore not marked with __THROW. */
|
||||
extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
|
||||
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/syslog.h */
|
||||
69
tasks/libposix/include/posix/sys/sysmacros.h
Normal file
69
tasks/libposix/include/posix/sys/sysmacros.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/* Definitions of macros to access `dev_t' values.
|
||||
Copyright (C) 1996, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_SYSMACROS_H
|
||||
#define _SYS_SYSMACROS_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* If the compiler does not know long long it is out of luck. We are
|
||||
not going to hack weird hacks to support the dev_t representation
|
||||
they need. */
|
||||
#if 1 /*def __GLIBC_HAVE_LONG_LONG uClibc note: always enable */
|
||||
__extension__
|
||||
static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
|
||||
__THROW;
|
||||
__extension__
|
||||
static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
|
||||
__THROW;
|
||||
__extension__
|
||||
static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
|
||||
unsigned int __minor)
|
||||
__THROW;
|
||||
|
||||
# if defined __GNUC__ && __GNUC__ >= 2
|
||||
__extension__ static __inline unsigned int
|
||||
__NTH (gnu_dev_major (unsigned long long int __dev))
|
||||
{
|
||||
return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
|
||||
}
|
||||
|
||||
__extension__ static __inline unsigned int
|
||||
__NTH (gnu_dev_minor (unsigned long long int __dev))
|
||||
{
|
||||
return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
|
||||
}
|
||||
|
||||
__extension__ static __inline unsigned long long int
|
||||
__NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
|
||||
{
|
||||
return ((__minor & 0xff) | ((__major & 0xfff) << 8)
|
||||
| (((unsigned long long int) (__minor & ~0xff)) << 12)
|
||||
| (((unsigned long long int) (__major & ~0xfff)) << 32));
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
/* Access the functions with their traditional names. */
|
||||
# define major(dev) gnu_dev_major (dev)
|
||||
# define minor(dev) gnu_dev_minor (dev)
|
||||
# define makedev(maj, min) gnu_dev_makedev (maj, min)
|
||||
#endif
|
||||
|
||||
#endif /* sys/sysmacros.h */
|
||||
4
tasks/libposix/include/posix/sys/termios.h
Normal file
4
tasks/libposix/include/posix/sys/termios.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef _SYS_TERMIOS_H
|
||||
#define _SYS_TERMIOS_H
|
||||
#include <termios.h>
|
||||
#endif
|
||||
192
tasks/libposix/include/posix/sys/time.h
Normal file
192
tasks/libposix/include/posix/sys/time.h
Normal file
@@ -0,0 +1,192 @@
|
||||
/* Copyright (C) 1991-1994,1996-2002,2003,2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_TIME_H
|
||||
#define _SYS_TIME_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types.h>
|
||||
#define __need_time_t
|
||||
#include <time.h>
|
||||
#define __need_timeval
|
||||
#include <bits/time.h>
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
#ifndef __suseconds_t_defined
|
||||
typedef __suseconds_t suseconds_t;
|
||||
# define __suseconds_t_defined
|
||||
#endif
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Macros for converting between `struct timeval' and `struct timespec'. */
|
||||
# define TIMEVAL_TO_TIMESPEC(tv, ts) { \
|
||||
(ts)->tv_sec = (tv)->tv_sec; \
|
||||
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
|
||||
}
|
||||
# define TIMESPEC_TO_TIMEVAL(tv, ts) { \
|
||||
(tv)->tv_sec = (ts)->tv_sec; \
|
||||
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Structure crudely representing a timezone.
|
||||
This is obsolete and should never be used. */
|
||||
struct timezone
|
||||
{
|
||||
int tz_minuteswest; /* Minutes west of GMT. */
|
||||
int tz_dsttime; /* Nonzero if DST is ever in effect. */
|
||||
};
|
||||
|
||||
typedef struct timezone *__restrict __timezone_ptr_t;
|
||||
#else
|
||||
typedef void *__restrict __timezone_ptr_t;
|
||||
#endif
|
||||
|
||||
/* Get the current time of day and timezone information,
|
||||
putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
|
||||
Returns 0 on success, -1 on errors.
|
||||
NOTE: This form of timezone information is obsolete.
|
||||
Use the functions and variables declared in <time.h> instead. */
|
||||
extern int gettimeofday (struct timeval *__restrict __tv,
|
||||
__timezone_ptr_t __tz) __THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Set the current time of day and timezone information.
|
||||
This call is restricted to the super-user. */
|
||||
extern int settimeofday (__const struct timeval *__tv,
|
||||
__const struct timezone *__tz)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
/* Adjust the current time of day by the amount in DELTA.
|
||||
If OLDDELTA is not NULL, it is filled in with the amount
|
||||
of time adjustment remaining to be done from the last `adjtime' call.
|
||||
This call is restricted to the super-user. */
|
||||
extern int adjtime (__const struct timeval *__delta,
|
||||
struct timeval *__olddelta) __THROW;
|
||||
#endif
|
||||
|
||||
|
||||
/* Values for the first argument to `getitimer' and `setitimer'. */
|
||||
enum __itimer_which
|
||||
{
|
||||
/* Timers run in real time. */
|
||||
ITIMER_REAL = 0,
|
||||
#define ITIMER_REAL ITIMER_REAL
|
||||
/* Timers run only when the process is executing. */
|
||||
ITIMER_VIRTUAL = 1,
|
||||
#define ITIMER_VIRTUAL ITIMER_VIRTUAL
|
||||
/* Timers run when the process is executing and when
|
||||
the system is executing on behalf of the process. */
|
||||
ITIMER_PROF = 2
|
||||
#define ITIMER_PROF ITIMER_PROF
|
||||
};
|
||||
|
||||
/* Type of the second argument to `getitimer' and
|
||||
the second and third arguments `setitimer'. */
|
||||
struct itimerval
|
||||
{
|
||||
/* Value to put into `it_value' when the timer expires. */
|
||||
struct timeval it_interval;
|
||||
/* Time to the next timer expiration. */
|
||||
struct timeval it_value;
|
||||
};
|
||||
|
||||
#if defined __USE_GNU && !defined __cplusplus
|
||||
/* Use the nicer parameter type only in GNU mode and not for C++ since the
|
||||
strict C++ rules prevent the automatic promotion. */
|
||||
typedef enum __itimer_which __itimer_which_t;
|
||||
#else
|
||||
typedef int __itimer_which_t;
|
||||
#endif
|
||||
|
||||
/* Set *VALUE to the current setting of timer WHICH.
|
||||
Return 0 on success, -1 on errors. */
|
||||
extern int getitimer (__itimer_which_t __which,
|
||||
struct itimerval *__value) __THROW;
|
||||
|
||||
/* Set the timer WHICH to *NEW. If OLD is not NULL,
|
||||
set *OLD to the old value of timer WHICH.
|
||||
Returns 0 on success, -1 on errors. */
|
||||
extern int setitimer (__itimer_which_t __which,
|
||||
__const struct itimerval *__restrict __new,
|
||||
struct itimerval *__restrict __old) __THROW;
|
||||
|
||||
/* Change the access time of FILE to TVP[0] and the modification time of
|
||||
FILE to TVP[1]. If TVP is a null pointer, use the current time instead.
|
||||
Returns 0 on success, -1 on errors. */
|
||||
extern int utimes (__const char *__file, __const struct timeval __tvp[2])
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#if 0 /*def __USE_BSD*/
|
||||
/* Same as `utimes', but does not follow symbolic links. */
|
||||
extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
/* Same as `utimes', but takes an open file descriptor instead of a name. */
|
||||
extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW;
|
||||
#endif
|
||||
|
||||
#if 0 /*def __USE_GNU*/
|
||||
/* Change the access time of FILE relative to FD to TVP[0] and the
|
||||
modification time of FILE to TVP[1]. If TVP is a null pointer, use
|
||||
the current time instead. Returns 0 on success, -1 on errors. */
|
||||
extern int futimesat (int __fd, __const char *__file,
|
||||
__const struct timeval __tvp[2]) __THROW;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Convenience macros for operations on timevals.
|
||||
NOTE: `timercmp' does not work for >= or <=. */
|
||||
# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
||||
# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
|
||||
# define timercmp(a, b, CMP) \
|
||||
(((a)->tv_sec == (b)->tv_sec) ? \
|
||||
((a)->tv_usec CMP (b)->tv_usec) : \
|
||||
((a)->tv_sec CMP (b)->tv_sec))
|
||||
# define timeradd(a, b, result) \
|
||||
do { \
|
||||
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
|
||||
(result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
|
||||
if ((result)->tv_usec >= 1000000) \
|
||||
{ \
|
||||
++(result)->tv_sec; \
|
||||
(result)->tv_usec -= 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
# define timersub(a, b, result) \
|
||||
do { \
|
||||
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
|
||||
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
|
||||
if ((result)->tv_usec < 0) { \
|
||||
--(result)->tv_sec; \
|
||||
(result)->tv_usec += 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
#endif /* BSD */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/time.h */
|
||||
46
tasks/libposix/include/posix/sys/timeb.h
Normal file
46
tasks/libposix/include/posix/sys/timeb.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* Copyright (C) 1994, 1995, 1996, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_TIMEB_H
|
||||
#define _SYS_TIMEB_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_time_t
|
||||
#include <time.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Structure returned by the `ftime' function. */
|
||||
|
||||
struct timeb
|
||||
{
|
||||
time_t time; /* Seconds since epoch, as from `time'. */
|
||||
unsigned short int millitm; /* Additional milliseconds. */
|
||||
short int timezone; /* Minutes west of GMT. */
|
||||
short int dstflag; /* Nonzero if Daylight Savings Time used. */
|
||||
};
|
||||
|
||||
/* Fill in TIMEBUF with information about the current time. */
|
||||
|
||||
extern int ftime (struct timeb *__timebuf);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/timeb.h */
|
||||
53
tasks/libposix/include/posix/sys/times.h
Normal file
53
tasks/libposix/include/posix/sys/times.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* Copyright (C) 1991, 1992, 1996, 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 4.5.2 Process Times <sys/times.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TIMES_H
|
||||
#define _SYS_TIMES_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_clock_t
|
||||
#include <time.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Structure describing CPU time used by a process and its children. */
|
||||
struct tms
|
||||
{
|
||||
clock_t tms_utime; /* User CPU time. */
|
||||
clock_t tms_stime; /* System CPU time. */
|
||||
|
||||
clock_t tms_cutime; /* User CPU time of dead children. */
|
||||
clock_t tms_cstime; /* System CPU time of dead children. */
|
||||
};
|
||||
|
||||
|
||||
/* Store the CPU time used by this process and all its
|
||||
dead children (and their dead children) in BUFFER.
|
||||
Return the elapsed real time, or (clock_t) -1 for errors.
|
||||
All times are in CLK_TCKths of a second. */
|
||||
extern clock_t times (struct tms *__buffer) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/times.h */
|
||||
127
tasks/libposix/include/posix/sys/timex.h
Normal file
127
tasks/libposix/include/posix/sys/timex.h
Normal file
@@ -0,0 +1,127 @@
|
||||
/* Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_TIMEX_H
|
||||
#define _SYS_TIMEX_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
/* These definitions from linux/timex.h as of 2.2.0. */
|
||||
|
||||
struct ntptimeval
|
||||
{
|
||||
struct timeval time; /* current time (ro) */
|
||||
long int maxerror; /* maximum error (us) (ro) */
|
||||
long int esterror; /* estimated error (us) (ro) */
|
||||
};
|
||||
|
||||
struct timex
|
||||
{
|
||||
unsigned int modes; /* mode selector */
|
||||
long int offset; /* time offset (usec) */
|
||||
long int freq; /* frequency offset (scaled ppm) */
|
||||
long int maxerror; /* maximum error (usec) */
|
||||
long int esterror; /* estimated error (usec) */
|
||||
int status; /* clock command/status */
|
||||
long int constant; /* pll time constant */
|
||||
long int precision; /* clock precision (usec) (read only) */
|
||||
long int tolerance; /* clock frequency tolerance (ppm) (read only) */
|
||||
struct timeval time; /* (read only) */
|
||||
long int tick; /* (modified) usecs between clock ticks */
|
||||
|
||||
long int ppsfreq; /* pps frequency (scaled ppm) (ro) */
|
||||
long int jitter; /* pps jitter (us) (ro) */
|
||||
int shift; /* interval duration (s) (shift) (ro) */
|
||||
long int stabil; /* pps stability (scaled ppm) (ro) */
|
||||
long int jitcnt; /* jitter limit exceeded (ro) */
|
||||
long int calcnt; /* calibration intervals (ro) */
|
||||
long int errcnt; /* calibration errors (ro) */
|
||||
long int stbcnt; /* stability limit exceeded (ro) */
|
||||
|
||||
/* ??? */
|
||||
int :32; int :32; int :32; int :32;
|
||||
int :32; int :32; int :32; int :32;
|
||||
int :32; int :32; int :32; int :32;
|
||||
};
|
||||
|
||||
/* Mode codes (timex.mode) */
|
||||
#define ADJ_OFFSET 0x0001 /* time offset */
|
||||
#define ADJ_FREQUENCY 0x0002 /* frequency offset */
|
||||
#define ADJ_MAXERROR 0x0004 /* maximum time error */
|
||||
#define ADJ_ESTERROR 0x0008 /* estimated time error */
|
||||
#define ADJ_STATUS 0x0010 /* clock status */
|
||||
#define ADJ_TIMECONST 0x0020 /* pll time constant */
|
||||
#define ADJ_TICK 0x4000 /* tick value */
|
||||
#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
|
||||
|
||||
/* xntp 3.4 compatibility names */
|
||||
#define MOD_OFFSET ADJ_OFFSET
|
||||
#define MOD_FREQUENCY ADJ_FREQUENCY
|
||||
#define MOD_MAXERROR ADJ_MAXERROR
|
||||
#define MOD_ESTERROR ADJ_ESTERROR
|
||||
#define MOD_STATUS ADJ_STATUS
|
||||
#define MOD_TIMECONST ADJ_TIMECONST
|
||||
#define MOD_CLKB ADJ_TICK
|
||||
#define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */
|
||||
|
||||
|
||||
/* Status codes (timex.status) */
|
||||
#define STA_PLL 0x0001 /* enable PLL updates (rw) */
|
||||
#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
|
||||
#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
|
||||
#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
|
||||
|
||||
#define STA_INS 0x0010 /* insert leap (rw) */
|
||||
#define STA_DEL 0x0020 /* delete leap (rw) */
|
||||
#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
|
||||
#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
|
||||
|
||||
#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
|
||||
#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
|
||||
#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
|
||||
#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
|
||||
|
||||
#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
|
||||
|
||||
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
|
||||
STA_PPSERROR | STA_CLOCKERR) /* read-only bits */
|
||||
|
||||
/* Clock states (time_state) */
|
||||
#define TIME_OK 0 /* clock synchronized, no leap second */
|
||||
#define TIME_INS 1 /* insert leap second */
|
||||
#define TIME_DEL 2 /* delete leap second */
|
||||
#define TIME_OOP 3 /* leap second in progress */
|
||||
#define TIME_WAIT 4 /* leap second has occurred */
|
||||
#define TIME_ERROR 5 /* clock not synchronized */
|
||||
#define TIME_BAD TIME_ERROR /* bw compat */
|
||||
|
||||
/* Maximum time constant of the PLL. */
|
||||
#define MAXTC 6
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int __adjtimex (struct timex *__ntx) __THROW;
|
||||
extern int adjtimex (struct timex *__ntx) __THROW;
|
||||
|
||||
extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
|
||||
extern int ntp_adjtime (struct timex *__tntx) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/timex.h */
|
||||
100
tasks/libposix/include/posix/sys/ttydefaults.h
Normal file
100
tasks/libposix/include/posix/sys/ttydefaults.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* System wide defaults for terminal state. Linux version.
|
||||
*/
|
||||
#ifndef _SYS_TTYDEFAULTS_H_
|
||||
#define _SYS_TTYDEFAULTS_H_
|
||||
|
||||
/*
|
||||
* Defaults on "first" open.
|
||||
*/
|
||||
#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
|
||||
#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
|
||||
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
|
||||
#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
|
||||
#define TTYDEF_SPEED (B9600)
|
||||
|
||||
/*
|
||||
* Control Character Defaults
|
||||
*/
|
||||
#define CTRL(x) (x&037)
|
||||
#define CEOF CTRL('d')
|
||||
#ifdef _POSIX_VDISABLE
|
||||
# define CEOL _POSIX_VDISABLE
|
||||
#else
|
||||
# define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */
|
||||
#endif
|
||||
#define CERASE 0177
|
||||
#define CINTR CTRL('c')
|
||||
#ifdef _POSIX_VDISABLE
|
||||
# define CSTATUS _POSIX_VDISABLE
|
||||
#else
|
||||
# define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */
|
||||
#endif
|
||||
#define CKILL CTRL('u')
|
||||
#define CMIN 1
|
||||
#define CQUIT 034 /* FS, ^\ */
|
||||
#define CSUSP CTRL('z')
|
||||
#define CTIME 0
|
||||
#define CDSUSP CTRL('y')
|
||||
#define CSTART CTRL('q')
|
||||
#define CSTOP CTRL('s')
|
||||
#define CLNEXT CTRL('v')
|
||||
#define CDISCARD CTRL('o')
|
||||
#define CWERASE CTRL('w')
|
||||
#define CREPRINT CTRL('r')
|
||||
#define CEOT CEOF
|
||||
/* compat */
|
||||
#define CBRK CEOL
|
||||
#define CRPRNT CREPRINT
|
||||
#define CFLUSH CDISCARD
|
||||
|
||||
/* PROTECTED INCLUSION ENDS HERE */
|
||||
#endif /* !_SYS_TTYDEFAULTS_H_ */
|
||||
|
||||
/*
|
||||
* #define TTYDEFCHARS to include an array of default control characters.
|
||||
*/
|
||||
#ifdef TTYDEFCHARS
|
||||
cc_t ttydefchars[NCCS] = {
|
||||
CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
|
||||
_POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
|
||||
CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
|
||||
};
|
||||
#undef TTYDEFCHARS
|
||||
#endif
|
||||
275
tasks/libposix/include/posix/sys/types.h
Normal file
275
tasks/libposix/include/posix/sys/types.h
Normal file
@@ -0,0 +1,275 @@
|
||||
/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#define _SYS_TYPES_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/types.h>
|
||||
|
||||
#ifdef __USE_BSD
|
||||
# ifndef __u_char_defined
|
||||
typedef __u_char u_char;
|
||||
typedef __u_short u_short;
|
||||
typedef __u_int u_int;
|
||||
typedef __u_long u_long;
|
||||
typedef __quad_t quad_t;
|
||||
typedef __u_quad_t u_quad_t;
|
||||
typedef __fsid_t fsid_t;
|
||||
# define __u_char_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef __loff_t loff_t;
|
||||
|
||||
#ifndef __ino_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __ino_t ino_t;
|
||||
# else
|
||||
typedef __ino64_t ino_t;
|
||||
# endif
|
||||
# define __ino_t_defined
|
||||
#endif
|
||||
#if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
|
||||
typedef __ino64_t ino64_t;
|
||||
# define __ino64_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __dev_t_defined
|
||||
typedef __dev_t dev_t;
|
||||
# define __dev_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __gid_t_defined
|
||||
typedef __gid_t gid_t;
|
||||
# define __gid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __mode_t_defined
|
||||
typedef __mode_t mode_t;
|
||||
# define __mode_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __nlink_t_defined
|
||||
typedef __nlink_t nlink_t;
|
||||
# define __nlink_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __uid_t_defined
|
||||
typedef __uid_t uid_t;
|
||||
# define __uid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __off_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __off_t off_t;
|
||||
# else
|
||||
typedef __off64_t off_t;
|
||||
# endif
|
||||
# define __off_t_defined
|
||||
#endif
|
||||
#if defined __USE_LARGEFILE64 && !defined __off64_t_defined
|
||||
typedef __off64_t off64_t;
|
||||
# define __off64_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __pid_t_defined
|
||||
typedef __pid_t pid_t;
|
||||
# define __pid_t_defined
|
||||
#endif
|
||||
|
||||
#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __id_t_defined
|
||||
typedef __id_t id_t;
|
||||
# define __id_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __ssize_t_defined
|
||||
typedef __ssize_t ssize_t;
|
||||
# define __ssize_t_defined
|
||||
#endif
|
||||
|
||||
#ifdef __USE_BSD
|
||||
# ifndef __daddr_t_defined
|
||||
typedef __daddr_t daddr_t;
|
||||
typedef __caddr_t caddr_t;
|
||||
# define __daddr_t_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __key_t_defined
|
||||
typedef __key_t key_t;
|
||||
# define __key_t_defined
|
||||
#endif
|
||||
|
||||
#ifdef __USE_XOPEN
|
||||
# define __need_clock_t
|
||||
#endif
|
||||
#define __need_time_t
|
||||
#define __need_timer_t
|
||||
#define __need_clockid_t
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __USE_XOPEN
|
||||
# ifndef __useconds_t_defined
|
||||
typedef __useconds_t useconds_t;
|
||||
# define __useconds_t_defined
|
||||
# endif
|
||||
# ifndef __suseconds_t_defined
|
||||
typedef __suseconds_t suseconds_t;
|
||||
# define __suseconds_t_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Old compatibility names for C types. */
|
||||
typedef unsigned long int ulong;
|
||||
typedef unsigned short int ushort;
|
||||
typedef unsigned int uint;
|
||||
#endif
|
||||
|
||||
/* These size-specific names are used by some of the inet code. */
|
||||
|
||||
#if !__GNUC_PREREQ (2, 7)
|
||||
|
||||
/* These types are defined by the ISO C99 header <inttypes.h>. */
|
||||
# ifndef __int8_t_defined
|
||||
# define __int8_t_defined
|
||||
typedef char int8_t;
|
||||
typedef short int int16_t;
|
||||
typedef int int32_t;
|
||||
# if __WORDSIZE == 64
|
||||
typedef long int int64_t;
|
||||
# elif defined __GNUC__ || defined __ICC
|
||||
__extension__ typedef long long int int64_t;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* But these were defined by ISO C without the first `_'. */
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef unsigned short int u_int16_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
# if __WORDSIZE == 64
|
||||
typedef unsigned long int u_int64_t;
|
||||
# elif defined __GNUC__ || defined __ICC
|
||||
__extension__ typedef unsigned long long int u_int64_t;
|
||||
# endif
|
||||
|
||||
typedef int register_t;
|
||||
|
||||
#else
|
||||
|
||||
/* For GCC 2.7 and later, we can use specific type-size attributes. */
|
||||
# define __intN_t(N, MODE) \
|
||||
typedef int int##N##_t __attribute__ ((__mode__ (MODE)))
|
||||
# define __u_intN_t(N, MODE) \
|
||||
typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
|
||||
|
||||
# ifndef __int8_t_defined
|
||||
# define __int8_t_defined
|
||||
__intN_t (8, __QI__);
|
||||
__intN_t (16, __HI__);
|
||||
__intN_t (32, __SI__);
|
||||
__intN_t (64, __DI__);
|
||||
# endif
|
||||
|
||||
__u_intN_t (8, __QI__);
|
||||
__u_intN_t (16, __HI__);
|
||||
__u_intN_t (32, __SI__);
|
||||
__u_intN_t (64, __DI__);
|
||||
|
||||
typedef int register_t __attribute__ ((__mode__ (__word__)));
|
||||
|
||||
|
||||
/* Some code from BIND tests this macro to see if the types above are
|
||||
defined. */
|
||||
#endif
|
||||
#define __BIT_TYPES_DEFINED__ 1
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* In BSD <sys/types.h> is expected to define BYTE_ORDER. */
|
||||
# include <endian.h>
|
||||
|
||||
/* It also defines `fd_set' and the FD_* macros for `select'. */
|
||||
# include <sys/select.h>
|
||||
|
||||
/* BSD defines these symbols, so we follow. */
|
||||
# include <sys/sysmacros.h>
|
||||
#endif /* Use BSD. */
|
||||
|
||||
|
||||
#if defined __USE_UNIX98 && !defined __blksize_t_defined
|
||||
typedef __blksize_t blksize_t;
|
||||
# define __blksize_t_defined
|
||||
#endif
|
||||
|
||||
/* Types from the Large File Support interface. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
# ifndef __blkcnt_t_defined
|
||||
typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */
|
||||
# define __blkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsblkcnt_t_defined
|
||||
typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
|
||||
# define __fsblkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsfilcnt_t_defined
|
||||
typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
|
||||
# define __fsfilcnt_t_defined
|
||||
# endif
|
||||
#else
|
||||
# ifndef __blkcnt_t_defined
|
||||
typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */
|
||||
# define __blkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsblkcnt_t_defined
|
||||
typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
|
||||
# define __fsblkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsfilcnt_t_defined
|
||||
typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
|
||||
# define __fsfilcnt_t_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */
|
||||
typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */
|
||||
typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Now add the thread types. */
|
||||
#if (defined __USE_POSIX199506 || defined __USE_UNIX98) && defined __UCLIBC_HAS_THREADS__
|
||||
# include <bits/pthreadtypes.h>
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/types.h */
|
||||
54
tasks/libposix/include/posix/sys/uio.h
Normal file
54
tasks/libposix/include/posix/sys/uio.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_UIO_H
|
||||
#define _SYS_UIO_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* This file defines `struct iovec'. */
|
||||
#include <bits/uio.h>
|
||||
|
||||
|
||||
/* Read data from file descriptor FD, and put the result in the
|
||||
buffers described by IOVEC, which is a vector of COUNT `struct iovec's.
|
||||
The buffers are filled in the order specified.
|
||||
Operates just like `read' (see <unistd.h>) except that data are
|
||||
put in IOVEC instead of a contiguous buffer.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count);
|
||||
|
||||
/* Write data pointed by the buffers described by IOVEC, which
|
||||
is a vector of COUNT `struct iovec's, to file descriptor FD.
|
||||
The data is written in the order specified.
|
||||
Operates just like `write' (see <unistd.h>) except that the data
|
||||
are taken from IOVEC instead of a contiguous buffer.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/uio.h */
|
||||
47
tasks/libposix/include/posix/sys/un.h
Normal file
47
tasks/libposix/include/posix/sys/un.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* Copyright (C) 1991, 1995, 1996, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_UN_H
|
||||
#define _SYS_UN_H 1
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* Get the definition of the macro to define the common sockaddr members. */
|
||||
#include <bits/sockaddr.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */
|
||||
struct sockaddr_un
|
||||
{
|
||||
__SOCKADDR_COMMON (sun_);
|
||||
char sun_path[108]; /* Path name. */
|
||||
};
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# include <string.h> /* For prototype of `strlen'. */
|
||||
|
||||
/* Evaluate to actual length of the `sockaddr_un' structure. */
|
||||
# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
|
||||
+ strlen ((ptr)->sun_path))
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/un.h */
|
||||
1
tasks/libposix/include/posix/sys/unistd.h
Normal file
1
tasks/libposix/include/posix/sys/unistd.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <unistd.h>
|
||||
38
tasks/libposix/include/posix/sys/ustat.h
Normal file
38
tasks/libposix/include/posix/sys/ustat.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* Header describing obsolete `ustat' interface.
|
||||
Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* This interface is obsolete. Use <sys/statfs.h> instead.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_USTAT_H
|
||||
#define _SYS_USTAT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <bits/ustat.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int ustat (__dev_t __dev, struct ustat *__ubuf) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ustat.h */
|
||||
74
tasks/libposix/include/posix/sys/utsname.h
Normal file
74
tasks/libposix/include/posix/sys/utsname.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* Copyright (C) 1991, 92, 94, 96, 97, 99 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 4.4 System Identification <sys/utsname.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_UTSNAME_H
|
||||
#define _SYS_UTSNAME_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/utsname.h>
|
||||
|
||||
#ifndef _UTSNAME_NODENAME_LENGTH
|
||||
# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
|
||||
#endif
|
||||
|
||||
/* Structure describing the system and machine. */
|
||||
struct utsname
|
||||
{
|
||||
/* Name of the implementation of the operating system. */
|
||||
char sysname[_UTSNAME_LENGTH];
|
||||
|
||||
/* Name of this node on the network. */
|
||||
char nodename[_UTSNAME_NODENAME_LENGTH];
|
||||
|
||||
/* Current release level of this implementation. */
|
||||
char release[_UTSNAME_LENGTH];
|
||||
/* Current version level of this release. */
|
||||
char version[_UTSNAME_LENGTH];
|
||||
|
||||
/* Name of the hardware type the system is running on. */
|
||||
char machine[_UTSNAME_LENGTH];
|
||||
|
||||
#if _UTSNAME_DOMAIN_LENGTH - 0
|
||||
/* Name of the domain of this node on the network. */
|
||||
# ifdef __USE_GNU
|
||||
char domainname[_UTSNAME_DOMAIN_LENGTH];
|
||||
# else
|
||||
char __domainname[_UTSNAME_DOMAIN_LENGTH];
|
||||
# endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef __USE_SVID
|
||||
# define SYS_NMLN _UTSNAME_LENGTH
|
||||
#endif
|
||||
|
||||
|
||||
/* Put information about the system in NAME. */
|
||||
extern int uname (struct utsname *__name) __THROW;
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/utsname.h */
|
||||
4
tasks/libposix/include/posix/sys/vfs.h
Normal file
4
tasks/libposix/include/posix/sys/vfs.h
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Other systems declare `struct statfs' et al in <sys/vfs.h>,
|
||||
so we have this file to be compatible with programs expecting it. */
|
||||
|
||||
#include <sys/statfs.h>
|
||||
1
tasks/libposix/include/posix/sys/vt.h
Normal file
1
tasks/libposix/include/posix/sys/vt.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <linux/vt.h>
|
||||
186
tasks/libposix/include/posix/sys/wait.h
Normal file
186
tasks/libposix/include/posix/sys/wait.h
Normal file
@@ -0,0 +1,186 @@
|
||||
/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_WAIT_H
|
||||
#define _SYS_WAIT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <signal.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
/* These macros could also be defined in <stdlib.h>. */
|
||||
#if !defined _STDLIB_H || !defined __USE_XOPEN
|
||||
/* This will define the `W*' macros for the flag
|
||||
bits to `waitpid', `wait3', and `wait4'. */
|
||||
# include <bits/waitflags.h>
|
||||
|
||||
# ifdef __USE_BSD
|
||||
|
||||
/* Lots of hair to allow traditional BSD use of `union wait'
|
||||
as well as POSIX.1 use of `int' for the status word. */
|
||||
|
||||
# if defined __GNUC__ && !defined __cplusplus
|
||||
# define __WAIT_INT(status) \
|
||||
(__extension__ (((union { __typeof(status) __in; int __i; }) \
|
||||
{ .__in = (status) }).__i))
|
||||
# else
|
||||
# define __WAIT_INT(status) (*(__const int *) &(status))
|
||||
# endif
|
||||
|
||||
/* This is the type of the argument to `wait'. The funky union
|
||||
causes redeclarations with ether `int *' or `union wait *' to be
|
||||
allowed without complaint. __WAIT_STATUS_DEFN is the type used in
|
||||
the actual function definitions. */
|
||||
|
||||
# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
|
||||
# define __WAIT_STATUS void *
|
||||
# define __WAIT_STATUS_DEFN void *
|
||||
# else
|
||||
/* This works in GCC 2.6.1 and later. */
|
||||
typedef union
|
||||
{
|
||||
union wait *__uptr;
|
||||
int *__iptr;
|
||||
} __WAIT_STATUS __attribute__ ((__transparent_union__));
|
||||
# define __WAIT_STATUS_DEFN int *
|
||||
# endif
|
||||
|
||||
# else /* Don't use BSD. */
|
||||
|
||||
# define __WAIT_INT(status) (status)
|
||||
# define __WAIT_STATUS int *
|
||||
# define __WAIT_STATUS_DEFN int *
|
||||
|
||||
# endif /* Use BSD. */
|
||||
|
||||
/* This will define all the `__W*' macros. */
|
||||
# include <bits/waitstatus.h>
|
||||
|
||||
# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
|
||||
# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
|
||||
# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
|
||||
# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
|
||||
# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
|
||||
# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
|
||||
# if 0 /*def __WIFCONTINUED*/
|
||||
# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
|
||||
# endif
|
||||
#endif /* <stdlib.h> not included. */
|
||||
|
||||
#ifdef __USE_BSD
|
||||
# define WCOREFLAG __WCOREFLAG
|
||||
# define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status))
|
||||
# define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
|
||||
# define W_STOPCODE(sig) __W_STOPCODE(sig)
|
||||
#endif
|
||||
|
||||
/* The following values are used by the `waitid' function. */
|
||||
#if defined __USE_SVID || defined __USE_XOPEN
|
||||
typedef enum
|
||||
{
|
||||
P_ALL, /* Wait for any child. */
|
||||
P_PID, /* Wait for specified process. */
|
||||
P_PGID /* Wait for members of process group. */
|
||||
} idtype_t;
|
||||
#endif
|
||||
|
||||
|
||||
/* Wait for a child to die. When one does, put its status in *STAT_LOC
|
||||
and return its process ID. For errors, return (pid_t) -1.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern __pid_t wait (__WAIT_STATUS __stat_loc);
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Special values for the PID argument to `waitpid' and `wait4'. */
|
||||
# define WAIT_ANY (-1) /* Any process. */
|
||||
# define WAIT_MYPGRP 0 /* Any process in my process group. */
|
||||
#endif
|
||||
|
||||
/* Wait for a child matching PID to die.
|
||||
If PID is greater than 0, match any process whose process ID is PID.
|
||||
If PID is (pid_t) -1, match any process.
|
||||
If PID is (pid_t) 0, match any process with the
|
||||
same process group as the current process.
|
||||
If PID is less than -1, match any process whose
|
||||
process group is the absolute value of PID.
|
||||
If the WNOHANG bit is set in OPTIONS, and that child
|
||||
is not already dead, return (pid_t) 0. If successful,
|
||||
return PID and store the dead child's status in STAT_LOC.
|
||||
Return (pid_t) -1 for errors. If the WUNTRACED bit is
|
||||
set in OPTIONS, return status for stopped children; otherwise don't.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
|
||||
|
||||
#if defined __USE_SVID || defined __USE_XOPEN
|
||||
# define __need_siginfo_t
|
||||
# include <bits/siginfo.h>
|
||||
/* Wait for a childing matching IDTYPE and ID to change the status and
|
||||
place appropriate information in *INFOP.
|
||||
If IDTYPE is P_PID, match any process whose process ID is ID.
|
||||
If IDTYPE is P_PGID, match any process whose process group is ID.
|
||||
If IDTYPE is P_ALL, match any process.
|
||||
If the WNOHANG bit is set in OPTIONS, and that child
|
||||
is not already dead, clear *INFOP and return 0. If successful, store
|
||||
exit code and status in *INFOP.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
|
||||
int __options);
|
||||
#endif
|
||||
|
||||
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
/* This being here makes the prototypes valid whether or not
|
||||
we have already included <sys/resource.h> to define `struct rusage'. */
|
||||
struct rusage;
|
||||
|
||||
/* Wait for a child to exit. When one does, put its status in *STAT_LOC and
|
||||
return its process ID. For errors return (pid_t) -1. If USAGE is not
|
||||
nil, store information about the child's resource usage there. If the
|
||||
WUNTRACED bit is set in OPTIONS, return status for stopped children;
|
||||
otherwise don't. */
|
||||
extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
|
||||
struct rusage * __usage) __THROW;
|
||||
#endif
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* This being here makes the prototypes valid whether or not
|
||||
we have already included <sys/resource.h> to define `struct rusage'. */
|
||||
struct rusage;
|
||||
|
||||
/* PID is like waitpid. Other args are like wait3. */
|
||||
extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
|
||||
struct rusage *__usage) __THROW;
|
||||
#endif /* Use BSD. */
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/wait.h */
|
||||
104
tasks/libposix/include/posix/sys/xattr.h
Normal file
104
tasks/libposix/include/posix/sys/xattr.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/* Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_XATTR_H
|
||||
#define _SYS_XATTR_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* The following constants should be used for the fifth parameter of
|
||||
`*setxattr'. */
|
||||
enum
|
||||
{
|
||||
XATTR_CREATE = 1, /* set value, fail if attr already exists. */
|
||||
#define XATTR_CREATE XATTR_CREATE
|
||||
XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */
|
||||
#define XATTR_REPLACE XATTR_REPLACE
|
||||
};
|
||||
|
||||
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which
|
||||
is SIZE bytes long). Return 0 on success, -1 for errors. */
|
||||
extern int setxattr (__const char *__path, __const char *__name,
|
||||
__const void *__value, size_t __size, int __flags)
|
||||
__THROW;
|
||||
|
||||
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which is
|
||||
SIZE bytes long), not following symlinks for the last pathname component.
|
||||
Return 0 on success, -1 for errors. */
|
||||
extern int lsetxattr (__const char *__path, __const char *__name,
|
||||
__const void *__value, size_t __size, int __flags)
|
||||
__THROW;
|
||||
|
||||
/* Set the attribute NAME of the file descriptor FD to VALUE (which is SIZE
|
||||
bytes long). Return 0 on success, -1 for errors. */
|
||||
extern int fsetxattr (int __fd, __const char *__name, __const void *__value,
|
||||
size_t __size, int __flags) __THROW;
|
||||
|
||||
/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
|
||||
SIZE bytes long). Return 0 on success, -1 for errors. */
|
||||
extern ssize_t getxattr (__const char *__path, __const char *__name,
|
||||
void *__value, size_t __size) __THROW;
|
||||
|
||||
/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
|
||||
SIZE bytes long), not following symlinks for the last pathname component.
|
||||
Return 0 on success, -1 for errors. */
|
||||
extern ssize_t lgetxattr (__const char *__path, __const char *__name,
|
||||
void *__value, size_t __size) __THROW;
|
||||
|
||||
/* Get the attribute NAME of the file descriptor FD to VALUE (which is SIZE
|
||||
bytes long). Return 0 on success, -1 for errors. */
|
||||
extern ssize_t fgetxattr (int __fd, __const char *__name, void *__value,
|
||||
size_t __size) __THROW;
|
||||
|
||||
/* List attributes of the file pointed to by PATH into the user-supplied
|
||||
buffer LIST (which is SIZE bytes big). Return 0 on success, -1 for
|
||||
errors. */
|
||||
extern ssize_t listxattr (__const char *__path, char *__list, size_t __size)
|
||||
__THROW;
|
||||
|
||||
/* List attributes of the file pointed to by PATH into the user-supplied
|
||||
buffer LIST (which is SIZE bytes big), not following symlinks for the
|
||||
last pathname component. Return 0 on success, -1 for errors. */
|
||||
extern ssize_t llistxattr (__const char *__path, char *__list, size_t __size)
|
||||
__THROW;
|
||||
|
||||
/* List attributes of the file descriptor FD into the user-supplied buffer
|
||||
LIST (which is SIZE bytes big). Return 0 on success, -1 for errors. */
|
||||
extern ssize_t flistxattr (int __fd, char *__list, size_t __size)
|
||||
__THROW;
|
||||
|
||||
/* Remove the attribute NAME from the file pointed to by PATH. Return 0
|
||||
on success, -1 for errors. */
|
||||
extern int removexattr (__const char *__path, __const char *__name) __THROW;
|
||||
|
||||
/* Remove the attribute NAME from the file pointed to by PATH, not
|
||||
following symlinks for the last pathname component. Return 0 on
|
||||
success, -1 for errors. */
|
||||
extern int lremovexattr (__const char *__path, __const char *__name) __THROW;
|
||||
|
||||
/* Remove the attribute NAME from the file descriptor FD. Return 0 on
|
||||
success, -1 for errors. */
|
||||
extern int fremovexattr (int __fd, __const char *__name) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/xattr.h */
|
||||
Reference in New Issue
Block a user