Some more [f]pathconf() names, not yet handled. filesizebits returns 64 though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25623 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4f20b083aa
commit
ca974ded95
@ -39,6 +39,7 @@
|
|||||||
#define _POSIX_THREADS (200112L)
|
#define _POSIX_THREADS (200112L)
|
||||||
|
|
||||||
/* pathconf() constants */
|
/* pathconf() constants */
|
||||||
|
/* BeOS supported values, do not touch */
|
||||||
#define _PC_CHOWN_RESTRICTED 1
|
#define _PC_CHOWN_RESTRICTED 1
|
||||||
#define _PC_MAX_CANON 2
|
#define _PC_MAX_CANON 2
|
||||||
#define _PC_MAX_INPUT 3
|
#define _PC_MAX_INPUT 3
|
||||||
@ -48,8 +49,25 @@
|
|||||||
#define _PC_PIPE_BUF 7
|
#define _PC_PIPE_BUF 7
|
||||||
#define _PC_VDISABLE 8
|
#define _PC_VDISABLE 8
|
||||||
#define _PC_LINK_MAX 25
|
#define _PC_LINK_MAX 25
|
||||||
|
/* new values */
|
||||||
|
/* TODO: reorder */
|
||||||
|
#define _PC_SYNC_IO 26
|
||||||
|
#define _PC_ASYNC_IO 27
|
||||||
|
#define _PC_PRIO_IO 28
|
||||||
|
#define _PC_SOCK_MAXBUF 29
|
||||||
|
#define _PC_FILESIZEBITS 30
|
||||||
|
#define _PC_REC_INCR_XFER_SIZE 31
|
||||||
|
#define _PC_REC_MAX_XFER_SIZE 32
|
||||||
|
#define _PC_REC_MIN_XFER_SIZE 33
|
||||||
|
#define _PC_REC_XFER_ALIGN 34
|
||||||
|
#define _PC_ALLOC_SIZE_MIN 35
|
||||||
|
#define _PC_SYMLINK_MAX 36
|
||||||
|
#define _PC_2_SYMLINKS 37
|
||||||
|
#define _PC_XATTR_EXISTS 38
|
||||||
|
#define _PC_XATTR_ENABLED 39
|
||||||
|
|
||||||
/* sysconf() constants */
|
/* sysconf() constants */
|
||||||
|
/* BeOS supported values, do not touch */
|
||||||
#define _SC_ARG_MAX 15
|
#define _SC_ARG_MAX 15
|
||||||
#define _SC_CHILD_MAX 16
|
#define _SC_CHILD_MAX 16
|
||||||
#define _SC_CLK_TCK 17
|
#define _SC_CLK_TCK 17
|
||||||
|
@ -80,6 +80,11 @@ sysconf(int name)
|
|||||||
long
|
long
|
||||||
fpathconf(int fd, int name)
|
fpathconf(int fd, int name)
|
||||||
{
|
{
|
||||||
|
if (fd < 0) {
|
||||||
|
errno = EBADF;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: should query the underlying filesystem
|
// TODO: should query the underlying filesystem
|
||||||
// for correct value, as most are fs-dependant
|
// for correct value, as most are fs-dependant
|
||||||
// (which is why it's a different call than sysconf() btw).
|
// (which is why it's a different call than sysconf() btw).
|
||||||
@ -111,6 +116,32 @@ fpathconf(int fd, int name)
|
|||||||
case _PC_VDISABLE:
|
case _PC_VDISABLE:
|
||||||
return _POSIX_VDISABLE;
|
return _POSIX_VDISABLE;
|
||||||
|
|
||||||
|
case _PC_FILESIZEBITS:
|
||||||
|
return 64;
|
||||||
|
|
||||||
|
case _PC_XATTR_EXISTS:
|
||||||
|
case _PC_XATTR_ENABLED:
|
||||||
|
/* those seem to be Solaris specific,
|
||||||
|
* else we should return 1 I suppose.
|
||||||
|
*/
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
case _PC_SYNC_IO:
|
||||||
|
case _PC_ASYNC_IO:
|
||||||
|
case _PC_PRIO_IO:
|
||||||
|
case _PC_SOCK_MAXBUF:
|
||||||
|
case _PC_REC_INCR_XFER_SIZE:
|
||||||
|
case _PC_REC_MAX_XFER_SIZE:
|
||||||
|
case _PC_REC_MIN_XFER_SIZE:
|
||||||
|
case _PC_REC_XFER_ALIGN:
|
||||||
|
case _PC_ALLOC_SIZE_MIN:
|
||||||
|
case _PC_SYMLINK_MAX:
|
||||||
|
case _PC_2_SYMLINKS:
|
||||||
|
/* not yet supported */
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user