Skip to content
1 change: 1 addition & 0 deletions arch/generic/bits/poll.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
typedef unsigned long nfds_t;
1 change: 0 additions & 1 deletion arch/ps4/bits/alltypes.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ TYPEDEF double double_t;

TYPEDEF unsigned int ino_t;
TYPEDEF unsigned int dev_t;
TYPEDEF unsigned int mode_t;
TYPEDEF unsigned short nlink_t;
TYPEDEF unsigned int blksize_t;

Expand Down
72 changes: 45 additions & 27 deletions arch/ps4/bits/fcntl.h
Original file line number Diff line number Diff line change
@@ -1,40 +1,58 @@
#define O_CREAT 01000
#define O_EXCL 04000
#define O_NOCTTY 0100000
#define O_TRUNC 02000
#define O_APPEND 010
#define O_NONBLOCK 04
#define O_DSYNC 0 // missing in freebsd headers
#define O_SYNC 0200
#define O_RSYNC 0 // missing in freebsd headers
#define O_DIRECTORY 0400000
#define O_NOFOLLOW 0400
#define O_CLOEXEC 04000000
struct flock {
off_t l_start;
off_t l_len;
pid_t l_pid;
short l_type;
short l_whence;
int l_sysid;
};

#define O_ASYNC 0100
#define O_DIRECT 0200000
#define O_LARGEFILE 0
#define O_NOATIME 0 // missing in freebsd headers
#define O_PATH 0 // missing in freebsd headers
#define O_TMPFILE 0 // missing in freebsd headers
#define O_NDELAY O_NONBLOCK
#define O_RDONLY 0x0
#define O_WRONLY 0x1
#define O_RDWR 0x2
#define O_ACCMODE 0x3
#define O_NONBLOCK 0x4
#define O_APPEND 0x8
#define O_SHLOCK 0x10
#define O_EXLOCK 0x20
#define O_ASYNC 0x40
#define O_SYNC 0x80
#define O_NOFOLLOW 0x100
#define O_CREAT 0x200
#define O_TRUNC 0x400
#define O_EXCL 0x800
#define O_DSYNC 0x1000
#define O_NOCTTY 0x8000
#define O_DIRECT 0x10000
#define O_DIRECTORY 0x20000
#define O_EXEC 0x40000
#define O_TTYINIT 0x80000
#define O_CLOEXEC 0x100000

#define F_DUPFD 0
#define F_GETFD 1
#define F_SETFD 2
#define F_GETFL 3
#define F_SETFL 4

#define F_SETOWN 6
#define F_GETOWN 5
//F_SETSIG is linux-specific
//F_GETSIG is linux-specific

#define F_SETOWN 6
#define F_DUP2FD 10
#define F_GETLK 11
#define F_SETLK 12
#define F_SETLKW 13
#define F_SETLK_REMOTE 14
#define F_READAHEAD 15
#define F_RDAHEAD 16
#define F_SET_SHM_APP_MAP_COUNT 17
#define F_DUPFD_RANDOM 18

#define F_UNLCKSYS 4
#define F_CANCEL 5

#define AT_FDCWD (-100)
#define AT_EACCESS 0x100
#define AT_SYMLINK_NOFOLLOW 0x200
#define AT_SYMLINK_FOLLOW 0x400
#define AT_REMOVEDIR 0x800

//F_SETOWN_EX is linux-specific
//F_GETOWN_EX is linux-specific

//F_GETOWNER_UIDS missing in freebsd headers
158 changes: 55 additions & 103 deletions arch/ps4/bits/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,108 +20,60 @@
/* this should be _IORW, but stdio got there first */
#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))

#define LINUX_TCGETS 0x5401
#define LINUX_TCSETS 0x5402
#define LINUX_TCSETSW 0x5403
#define LINUX_TCSETSF 0x5404
#define LINUX_TCGETA 0x5405
#define LINUX_TCSETA 0x5406
#define LINUX_TCSETAW 0x5407
#define LINUX_TCSETAF 0x5408
#define LINUX_TCSBRK 0x5409
#define LINUX_TCXONC 0x540A
#define LINUX_TCFLSH 0x540B
#define LINUX_TIOCEXCL 0x540C
#define LINUX_TIOCNXCL 0x540D
#define LINUX_TIOCSCTTY 0x540E
#define LINUX_TIOCGPGRP 0x540F
#define LINUX_TIOCSPGRP 0x5410
#define LINUX_TIOCOUTQ 0x5411
#define LINUX_TIOCSTI 0x5412
#define LINUX_TIOCGWINSZ 0x5413
#define LINUX_TIOCSWINSZ 0x5414
#define LINUX_TIOCMGET 0x5415
#define LINUX_TIOCMBIS 0x5416
#define LINUX_TIOCMBIC 0x5417
#define LINUX_TIOCMSET 0x5418
#define LINUX_TIOCGSOFTCAR 0x5419
#define LINUX_TIOCSSOFTCAR 0x541A
#define LINUX_FIONREAD 0x541B
#define LINUX_TIOCINQ FIONREAD
#define LINUX_TIOCLINUX 0x541C
#define LINUX_TIOCCONS 0x541D
#define LINUX_TIOCGSERIAL 0x541E
#define LINUX_TIOCSSERIAL 0x541F
#define LINUX_TIOCPKT 0x5420
#define LINUX_FIONBIO 0x5421
#define LINUX_TIOCNOTTY 0x5422
#define LINUX_TIOCSETD 0x5423
#define LINUX_TIOCGETD 0x5424
#define LINUX_TCSBRKP 0x5425
#define LINUX_TIOCSBRK 0x5427
#define LINUX_TIOCCBRK 0x5428
#define LINUX_TIOCGSID 0x5429
#define LINUX_TIOCGRS485 0x542E
#define LINUX_TIOCSRS485 0x542F
#define LINUX_TIOCGPTN 0x80045430
#define LINUX_TIOCSPTLCK 0x40045431
#define LINUX_TIOCGDEV 0x80045432
#define LINUX_TCGETX 0x5432
#define LINUX_TCSETX 0x5433
#define LINUX_TCSETXF 0x5434
#define LINUX_TCSETXW 0x5435
#define LINUX_TIOCSIG 0x40045436
#define LINUX_TIOCVHANGUP 0x5437
#define LINUX_TIOCGPKT 0x80045438
#define LINUX_TIOCGPTLCK 0x80045439
#define LINUX_TIOCGEXCL 0x80045440
#define LINUX_TIOCGPTPEER 0x5441
#define LINUX_TIOCGISO7816 0x80285442
#define LINUX_TIOCSISO7816 0xc0285443
#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */
#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */
#define TIOCGPTN _IOR('t', 15, int) /* Get pts number. */
#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */
#define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */
#define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */
#define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */
#define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */
#define TIOCGETD _IOR('t', 26, int) /* get line discipline */
#define TIOCSETD _IOW('t', 27, int) /* set line discipline */
#define TIOCPTMASTER _IO('t', 28) /* pts master validation */
#define TIOCGDRAINWAIT _IOR('t', 86, int) /* get ttywait timeout */
#define TIOCSDRAINWAIT _IOW('t', 87, int) /* set ttywait timeout */
#define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* enable/get timestamp of last input event */
#define TIOCMGDTRWAIT _IOR('t', 90, int) /* modem: get wait on close */
#define TIOCMSDTRWAIT _IOW('t', 91, int) /* modem: set wait on close */
#define TIOCDRAIN _IO('t', 94) /* wait till output drained */
#define TIOCSIG _IOWINT('t', 95) /* pty: generate signal */
#define TIOCEXT _IOW('t', 96, int) /* pty: external processing */
#define TIOCSCTTY _IO('t', 97) /* become controlling tty */
#define TIOCCONS _IOW('t', 98, int) /* become virtual console */
#define TIOCGSID _IOR('t', 99, int) /* get session id */
#define TIOCSTAT _IO('t', 101) /* simulate ^T status message */
#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */
#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */
#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */
#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */
#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */
#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */
#define TIOCNOTTY _IO('t', 113) /* void tty association */
#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */
#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */
#define TIOCSDTR _IO('t', 121) /* set data terminal ready */
#define TIOCCBRK _IO('t', 122) /* clear break bit */
#define TIOCSBRK _IO('t', 123) /* set break bit */

#define LINUX_FIONCLEX 0x5450
#define LINUX_FIOCLEX 0x5451
#define LINUX_FIOASYNC 0x5452
#define LINUX_TIOCSERCONFIG 0x5453
#define LINUX_TIOCSERGWILD 0x5454
#define LINUX_TIOCSERSWILD 0x5455
#define LINUX_TIOCGLCKTRMIOS 0x5456
#define LINUX_TIOCSLCKTRMIOS 0x5457
#define LINUX_TIOCSERGSTRUCT 0x5458
#define LINUX_TIOCSERGETLSR 0x5459
#define LINUX_TIOCSERGETMULTI 0x545A
#define LINUX_TIOCSERSETMULTI 0x545B
#define TIOCM_LE 0001 /* line enable */
#define TIOCM_DTR 0002 /* data terminal ready */
#define TIOCM_RTS 0004 /* request to send */
#define TIOCM_ST 0010 /* secondary transmit */
#define TIOCM_SR 0020 /* secondary receive */
#define TIOCM_CTS 0040 /* clear to send */
#define TIOCM_DCD 0100 /* data carrier detect */
#define TIOCM_RI 0200 /* ring indicate */
#define TIOCM_DSR 0400 /* data set ready */
#define TIOCM_CD TIOCM_DCD
#define TIOCM_CAR TIOCM_DCD
#define TIOCM_RNG TIOCM_RI

#define LINUX_TIOCMIWAIT 0x545C
#define LINUX_TIOCGICOUNT 0x545D
#define LINUX_FIOQSIZE 0x5460

#define LINUX_TIOCM_LE 0x001
#define LINUX_TIOCM_DTR 0x002
#define LINUX_TIOCM_RTS 0x004
#define LINUX_TIOCM_ST 0x008
#define LINUX_TIOCM_SR 0x010
#define LINUX_TIOCM_CTS 0x020
#define LINUX_TIOCM_CAR 0x040
#define LINUX_TIOCM_RNG 0x080
#define LINUX_TIOCM_DSR 0x100
#define LINUX_TIOCM_CD LINUX_TIOCM_CAR
#define LINUX_TIOCM_RI LINUX_TIOCM_RNG
#define LINUX_TIOCM_OUT1 0x2000
#define LINUX_TIOCM_OUT2 0x4000
#define LINUX_TIOCM_LOOP 0x8000

#define LINUX_FIOSETOWN 0x8901
#define LINUX_SIOCSPGRP 0x8902
#define LINUX_FIOGETOWN 0x8903
#define LINUX_SIOCGPGRP 0x8904
#define LINUX_SIOCATMARK 0x8905
#if __LONG_MAX == 0x7fffffff
#define LINUX_SIOCGSTAMP _IOR(0x89, 6, char[16])
#define LINUX_SIOCGSTAMPNS _IOR(0x89, 7, char[16])
#else
#define LINUX_SIOCGSTAMP 0x8906
#define LINUX_SIOCGSTAMPNS 0x8907
#endif

#include <bits/ioctl_fix.h>
#include <bits/ioctl_fix.h>
Loading