Clean up libsysio compiler warnings on XT3.
b=12332
i=adilger
i=walter
21 files changed:
assert(*offset >= 0);
off = *offset;
assert(*offset >= 0);
off = *offset;
-#if _LARGEFILE64_SOURCE && defined(SYSIO_SYS__llseek)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYSIO_SYS__llseek)
#define _SEEK_MAX(fil) \
(_F_LARGEFILE(fil) ? _SYSIO_OFF_T_MAX : LONG_MAX)
#define _SEEK_MAX(fil) \
(_F_LARGEFILE(fil) ? _SYSIO_OFF_T_MAX : LONG_MAX)
+#ifdef _LARGEFILE64_SOURCE
#define _SYSIO_FLOCK flock64
#else
#define _SYSIO_FLOCK flock
#define _SYSIO_FLOCK flock64
#else
#define _SYSIO_FLOCK flock
extern int _sysio_fd_set(struct file *fil, int fd, int force);
extern int _sysio_fd_dup(int oldfd, int newfd, int force);
extern int _sysio_fd_close_all(void);
extern int _sysio_fd_set(struct file *fil, int fd, int force);
extern int _sysio_fd_dup(int oldfd, int newfd, int force);
extern int _sysio_fd_close_all(void);
extern void _sysio_fd_shutdown(void);
#endif
extern _SYSIO_OFF_T _sysio_lseek_prepare(struct file *fil,
extern void _sysio_fd_shutdown(void);
#endif
extern _SYSIO_OFF_T _sysio_lseek_prepare(struct file *fil,
-#if _LARGEFILE64_SOURCE && defined(SYS_lstat64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_lstat64)
#define SYSIO_SYS_stat SYS_lstat64
#elif defined(SYS_lstat)
#define SYSIO_SYS_stat SYS_lstat
#endif
#define SYSIO_SYS_stat SYS_lstat64
#elif defined(SYS_lstat)
#define SYSIO_SYS_stat SYS_lstat
#endif
-#if _LARGEFILE64_SOURCE && defined(SYS_fstat64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_fstat64)
#define SYSIO_SYS_fstat SYS_fstat64
#elif defined(SYS_fstat)
#define SYSIO_SYS_fstat SYS_fstat
#endif
#define SYSIO_SYS_fstat SYS_fstat64
#elif defined(SYS_fstat)
#define SYSIO_SYS_fstat SYS_fstat
#endif
-#if _LARGEFILE64_SOURCE && defined(SYS_truncate64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_truncate64)
#define SYSIO_SYS_truncate SYS_truncate64
#elif defined(SYS_truncate)
#define SYSIO_SYS_truncate SYS_truncate
#endif
#define SYSIO_SYS_truncate SYS_truncate64
#elif defined(SYS_truncate)
#define SYSIO_SYS_truncate SYS_truncate
#endif
-#if _LARGEFILE64_SOURCE && defined(SYS_ftruncate64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_ftruncate64)
#define SYSIO_SYS_ftruncate SYS_ftruncate64
#elif defined(SYS_ftruncate)
#define SYSIO_SYS_ftruncate SYS_ftruncate
#define SYSIO_SYS_ftruncate SYS_ftruncate64
#elif defined(SYS_ftruncate)
#define SYSIO_SYS_ftruncate SYS_ftruncate
#if defined(SYS_close)
#define SYSIO_SYS_close SYS_close
#endif
#if defined(SYS_close)
#define SYSIO_SYS_close SYS_close
#endif
-#if _LARGEFILE64_SOURCE && defined(SYS_lseek64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_lseek64)
#define SYSIO_SYS_lseek SYS_lseek64
#elif defined(SYS_lseek)
#define SYSIO_SYS_lseek SYS_lseek
#define SYSIO_SYS_lseek SYS_lseek64
#elif defined(SYS_lseek)
#define SYSIO_SYS_lseek SYS_lseek
#if defined(SYS_writev)
#define SYSIO_SYS_writev SYS_writev
#endif
#if defined(SYS_writev)
#define SYSIO_SYS_writev SYS_writev
#endif
-#if _LARGEFILE64_SOURCE && defined(SYS_pread64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_pread64)
#define SYSIO_SYS_pread SYS_pread64
#elif defined(SYS_pread)
#define SYSIO_SYS_pread SYS_pread
#endif
#define SYSIO_SYS_pread SYS_pread64
#elif defined(SYS_pread)
#define SYSIO_SYS_pread SYS_pread
#endif
-#if _LARGEFILE64_SOURCE && defined(SYS_pwrite64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_pwrite64)
#define SYSIO_SYS_pwrite SYS_pwrite64
#elif defined(SYS_pwrite)
#define SYSIO_SYS_pwrite SYS_pwrite
#endif
#define SYSIO_SYS_pwrite SYS_pwrite64
#elif defined(SYS_pwrite)
#define SYSIO_SYS_pwrite SYS_pwrite
#endif
-#if _LARGEFILE64_SOURCE && defined(SYS_fcntl64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_fcntl64)
#define SYSIO_SYS_fcntl SYS_fcntl64
#elif defined(SYS_fcntl)
#define SYSIO_SYS_fcntl SYS_fcntl
#define SYSIO_SYS_fcntl SYS_fcntl64
#elif defined(SYS_fcntl)
#define SYSIO_SYS_fcntl SYS_fcntl
#if defined(SYS_fsync)
#define SYSIO_SYS_fsync SYS_fsync
#endif
#if defined(SYS_fsync)
#define SYSIO_SYS_fsync SYS_fsync
#endif
-#if ALPHA_LINUX && defined(SYS_osf_fdatasync)
+#if defined(ALPHA_LINUX) && defined(SYS_osf_fdatasync)
#define SYSIO_SYS_fdatasync SYS_osf_fdatasync
#elif defined(SYS_fdatasync)
#define SYSIO_SYS_fdatasync SYS_fdatasync
#define SYSIO_SYS_fdatasync SYS_osf_fdatasync
#elif defined(SYS_fdatasync)
#define SYSIO_SYS_fdatasync SYS_fdatasync
#define SYSIO_SYS_rmdir SYS_rmdir
#endif
#if defined(SYS_getdirentries)
#define SYSIO_SYS_rmdir SYS_rmdir
#endif
#if defined(SYS_getdirentries)
-#if _LARGEFILE64_SOURCE && defined(SYS_getdirentries64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_getdirentries64)
#define SYSIO_SYS_getdirentries SYS_getdirentries64
#elif defined(SYS_getdirentries)
#define SYSIO_SYS_getdirentries SYS_getdirentries
#endif
#endif
#define SYSIO_SYS_getdirentries SYS_getdirentries64
#elif defined(SYS_getdirentries)
#define SYSIO_SYS_getdirentries SYS_getdirentries
#endif
#endif
-#if _LARGEFILE64_SOURCE && defined(SYS_getdents64)
+#if defined(_LARGEFILE64_SOURCE) && defined(SYS_getdents64)
# define SYSIO_SYS_getdents64 SYS_getdents64
#elif defined(SYS_getdents)
# if defined (__mips64__)
# define SYSIO_SYS_getdents64 SYS_getdents64
#elif defined(SYS_getdents)
# if defined (__mips64__)
#define __IS_UNUSED
#endif
#define __IS_UNUSED
#endif
-#ifndef _LARGEFILE64_SOURCE
-/*
- * Not glibc I guess. Define this ourselves.
- */
-#define _LARGEFILE64_SOURCE 0
-#endif
-
/*
* Define internal file-offset type and it's maximum value.
*/
/*
* Define internal file-offset type and it's maximum value.
*/
+#ifdef _LARGEFILE64_SOURCE
#define _SYSIO_OFF_T off64_t
#ifdef LLONG_MAX
#define _SYSIO_OFF_T_MAX (LLONG_MAX)
#define _SYSIO_OFF_T off64_t
#ifdef LLONG_MAX
#define _SYSIO_OFF_T_MAX (LLONG_MAX)
* Internally, all file status is carried in the 64-bit capable
* structure.
*/
* Internally, all file status is carried in the 64-bit capable
* structure.
*/
+#ifdef _LARGEFILE64_SOURCE
#define intnl_xtvec xtvec64
#else
#define intnl_xtvec xtvec
#define intnl_xtvec xtvec64
#else
#define intnl_xtvec xtvec
* Internally, all directory entries are carried in the 64-bit capable
* structure.
*/
* Internally, all directory entries are carried in the 64-bit capable
* structure.
*/
+#ifdef _LARGEFILE64_SOURCE
#define intnl_dirent dirent64
#else
#define intnl_dirent dirent
#define intnl_dirent dirent64
#else
#define intnl_dirent dirent
* Internally, all file status is carried in the 64-bit capable
* structure.
*/
* Internally, all file status is carried in the 64-bit capable
* structure.
*/
+#ifdef _LARGEFILE64_SOURCE
#define intnl_stat stat64
#else
#define intnl_stat stat
#define intnl_stat stat64
#else
#define intnl_stat stat
struct stat;
#ifdef _HAVE_STATVFS
struct stat;
#ifdef _HAVE_STATVFS
+#ifdef _LARGEFILE64_SOURCE
#define intnl_statvfs statvfs64
#else
#define intnl_statvfs statvfs
#define intnl_statvfs statvfs64
#else
#define intnl_statvfs statvfs
extern int SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...);
extern int SYSIO_INTERFACE_NAME(fcntl64)(int fd, int cmd, ...);
extern int SYSIO_INTERFACE_NAME(fstat)(int fd, struct stat *buf);
extern int SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...);
extern int SYSIO_INTERFACE_NAME(fcntl64)(int fd, int cmd, ...);
extern int SYSIO_INTERFACE_NAME(fstat)(int fd, struct stat *buf);
+#ifdef _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf);
extern int SYSIO_INTERFACE_NAME(lstat64)(const char *path, struct stat64 *buf);
#endif
extern int SYSIO_INTERFACE_NAME(fsync)(int fd);
extern char *SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size);
extern off_t SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence);
extern int SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf);
extern int SYSIO_INTERFACE_NAME(lstat64)(const char *path, struct stat64 *buf);
#endif
extern int SYSIO_INTERFACE_NAME(fsync)(int fd);
extern char *SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size);
extern off_t SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence);
+#ifdef _LARGEFILE64_SOURCE
extern off64_t SYSIO_INTERFACE_NAME(lseek64)(int fd, off64_t offset,
int whence);
#endif
extern off64_t SYSIO_INTERFACE_NAME(lseek64)(int fd, off64_t offset,
int whence);
#endif
#else
extern ssize_t SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf,
size_t nbytes, off_t *basep);
#else
extern ssize_t SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf,
size_t nbytes, off_t *basep);
+#ifdef _LARGEFILE64_SOURCE
extern ssize_t SYSIO_INTERFACE_NAME(getdirentries64)(int fd,
char *buf,
size_t nbytes,
extern ssize_t SYSIO_INTERFACE_NAME(getdirentries64)(int fd,
char *buf,
size_t nbytes,
#endif
extern int SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode);
extern int SYSIO_INTERFACE_NAME(open)(const char *path, int flag, ...);
#endif
extern int SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode);
extern int SYSIO_INTERFACE_NAME(open)(const char *path, int flag, ...);
+#ifdef _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(open64)(const char *path, int flag, ...);
#endif
extern int SYSIO_INTERFACE_NAME(creat)(const char *path, mode_t mode);
extern int SYSIO_INTERFACE_NAME(open64)(const char *path, int flag, ...);
#endif
extern int SYSIO_INTERFACE_NAME(creat)(const char *path, mode_t mode);
+#ifdef _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(creat64)(const char *path, mode_t mode);
#endif
extern int SYSIO_INTERFACE_NAME(stat)(const char *path, struct stat *buf);
extern int SYSIO_INTERFACE_NAME(creat64)(const char *path, mode_t mode);
#endif
extern int SYSIO_INTERFACE_NAME(stat)(const char *path, struct stat *buf);
+#ifdef _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(stat64)(const char *path, struct stat64 *buf);
#endif
extern ssize_t SYSIO_INTERFACE_NAME(read)(int fd, void *buf, size_t count);
extern int SYSIO_INTERFACE_NAME(stat64)(const char *path, struct stat64 *buf);
#endif
extern ssize_t SYSIO_INTERFACE_NAME(read)(int fd, void *buf, size_t count);
int count);
#ifdef _HAVE_STATVFS
extern int SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf);
int count);
#ifdef _HAVE_STATVFS
extern int SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf);
+#ifdef _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(statvfs64)(const char *path,
struct statvfs64 *buf);
#endif
extern int SYSIO_INTERFACE_NAME(fstatvfs)(int fd, struct statvfs *buf);
extern int SYSIO_INTERFACE_NAME(statvfs64)(const char *path,
struct statvfs64 *buf);
#endif
extern int SYSIO_INTERFACE_NAME(fstatvfs)(int fd, struct statvfs *buf);
+#ifdef _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf);
#endif
#endif
extern int SYSIO_INTERFACE_NAME(truncate)(const char *path, off_t length);
extern int SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf);
#endif
#endif
extern int SYSIO_INTERFACE_NAME(truncate)(const char *path, off_t length);
+#ifdef _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(truncate64)(const char *path, off64_t length);
#endif
extern int SYSIO_INTERFACE_NAME(ftruncate)(int fd, off_t length);
extern int SYSIO_INTERFACE_NAME(truncate64)(const char *path, off64_t length);
#endif
extern int SYSIO_INTERFACE_NAME(ftruncate)(int fd, off_t length);
+#ifdef _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(ftruncate64)(int fd, off64_t length);
#endif
extern int SYSIO_INTERFACE_NAME(rmdir)(const char *path);
extern int SYSIO_INTERFACE_NAME(ftruncate64)(int fd, off64_t length);
#endif
extern int SYSIO_INTERFACE_NAME(rmdir)(const char *path);
size_t count,
off_t offset);
size_t count,
off_t offset);
+#ifdef _LARGEFILE64_SOURCE
/*
* Post asynch read into buffers mapped by an iovec from file at given offset.
*/
/*
* Post asynch read into buffers mapped by an iovec from file at given offset.
*/
size_t count,
off_t offset);
size_t count,
off_t offset);
+#ifdef _LARGEFILE64_SOURCE
/*
* Post asynch read into buffer from file at given offset.
*/
/*
* Post asynch read into buffer from file at given offset.
*/
size_t count,
off_t offset);
size_t count,
off_t offset);
+#ifdef _LARGEFILE64_SOURCE
/*
* Read into buffers mapped by an iovec from file at given offset.
*/
/*
* Read into buffers mapped by an iovec from file at given offset.
*/
const struct iovec *iov,
size_t count,
off_t offset);
const struct iovec *iov,
size_t count,
off_t offset);
+#ifdef _LARGEFILE64_SOURCE
/*
* Post asynch write from buffers mapped by an iovec to file at given offset.
*/
/*
* Post asynch write from buffers mapped by an iovec to file at given offset.
*/
size_t count,
off_t offset);
size_t count,
off_t offset);
+#ifdef _LARGEFILE64_SOURCE
/*
* Post asynch write from buffer to file at given offset.
*/
/*
* Post asynch write from buffer to file at given offset.
*/
size_t count,
off_t offset);
size_t count,
off_t offset);
+#ifdef _LARGEFILE64_SOURCE
/*
* Write from buffers mapped by an iovec to file at given offset.
*/
/*
* Write from buffers mapped by an iovec to file at given offset.
*/
#include "file.h"
#include "sysio-symbols.h"
#include "file.h"
#include "sysio-symbols.h"
const char *_sysio_init_cwd = NULL;
#endif
const char *_sysio_init_cwd = NULL;
#endif
SYSIO_INTERFACE_DISPLAY_BLOCK;
SYSIO_INTERFACE_ENTER;
SYSIO_INTERFACE_DISPLAY_BLOCK;
SYSIO_INTERFACE_ENTER;
if (!_sysio_cwd) {
struct pnode *pno;
if (!_sysio_cwd) {
struct pnode *pno;
-#if !(_LARGEFILE64_SOURCE || F_GETLK64 == F_GETLK)
+#if !(defined(_LARGEFILE64_SOURCE) || F_GETLK64 == F_GETLK)
case F_GETLK:
case F_SETLK:
case F_SETLKW:
{
struct intnl_stat buf;
struct flock *fl;
case F_GETLK:
case F_SETLK:
case F_SETLKW:
{
struct intnl_stat buf;
struct flock *fl;
+#ifdef _LARGEFILE64_SOURCE
struct _SYSIO_FLOCK flock64;
#endif
struct _SYSIO_FLOCK flock64;
#endif
* Copy args to a temp and normalize.
*/
fl = va_arg(ap, struct flock *);
* Copy args to a temp and normalize.
*/
fl = va_arg(ap, struct flock *);
+#ifdef _LARGEFILE64_SOURCE
flock64.l_type = fl->l_type;
flock64.l_whence = fl->l_whence;
flock64.l_start = fl->l_start;
flock64.l_type = fl->l_type;
flock64.l_whence = fl->l_whence;
flock64.l_start = fl->l_start;
+#ifdef _LARGEFILE64_SOURCE
/*
* Copy back. Note that the fcntl_lock call
* should have ensured that no overflow was possible.
/*
* Copy back. Note that the fcntl_lock call
* should have ensured that no overflow was possible.
}
break;
#endif /* !(_LARGEFILE64_SOURCE || F_GETLK64 == F_GETLK) */
}
break;
#endif /* !(_LARGEFILE64_SOURCE || F_GETLK64 == F_GETLK) */
+#ifdef _LARGEFILE64_SOURCE
case F_GETLK64:
case F_SETLK64:
case F_SETLKW64:
case F_GETLK64:
case F_SETLK64:
case F_SETLKW64:
void
_sysio_fd_shutdown()
{
void
_sysio_fd_shutdown()
{
static void free_oftab(oftab_t *ot)
{
if (ot->table) {
static void free_oftab(oftab_t *ot)
{
if (ot->table) {
SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0);
}
SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0);
}
+#ifdef _LARGEFILE64_SOURCE
#undef getdirentries64
sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64)),
SYSIO_INTERFACE_NAME(getdirentries64))
#undef getdirentries64
sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64)),
SYSIO_INTERFACE_NAME(getdirentries64))
#define _BSD_SOURCE
#endif
#define _BSD_SOURCE
#endif
#include <stdio.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#endif
#include <stdlib.h>
+#if defined(_BSD_SOURCE) || defined(SYSIO_TRACING)
#include <sys/syscall.h>
#endif
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/syscall.h>
#endif
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stdarg.h>
#endif
#include <limits.h>
#include <stdarg.h>
#endif
#include <limits.h>
#include "sysio.h"
#include "xtio.h"
#include "sysio.h"
#include "xtio.h"
#include "native.h"
#endif
#include "inode.h"
#include "native.h"
#endif
#include "inode.h"
#include "stdfd.h"
#endif
#include "stdfd.h"
#endif
/*
* Tracing callback record.
/*
* Tracing callback record.
extern int _sysio_sockets_init(void);
#endif
extern int _sysio_sockets_init(void);
#endif
/*
* Initialize tracing callback queues.
*/
/*
* Initialize tracing callback queues.
*/
_sysio_unmount_all() == 0))
abort();
_sysio_unmount_all() == 0))
abort();
_sysio_fd_shutdown();
_sysio_i_shutdown();
_sysio_fssw_shutdown();
_sysio_access_shutdown();
_sysio_fd_shutdown();
_sysio_i_shutdown();
_sysio_fssw_shutdown();
_sysio_access_shutdown();
{
struct trace_callback *tcb;
{
struct trace_callback *tcb;
#if !(defined(_HAVE_ASPRINTF) && _HAVE_ASPRINTF)
/*
#if !(defined(_HAVE_ASPRINTF) && _HAVE_ASPRINTF)
/*
/*
* Set/Unset tracing.
*/
/*
* Set/Unset tracing.
*/
if (err)
_sysio_cprintf("+NS init+ failed at expr %u (last = %s): %s\n",
count,
if (err)
_sysio_cprintf("+NS init+ failed at expr %u (last = %s): %s\n",
count,
/*
* Set deferred initial working directory.
*/
/*
* Set deferred initial working directory.
*/
/*
* Given an identifier and it's arguments, perform optional initializations.
*/
/*
* Given an identifier and it's arguments, perform optional initializations.
*/
_sysio_boot(const char *opt, const char *arg)
{
struct option_value_info vec[] = {
_sysio_boot(const char *opt, const char *arg)
{
struct option_value_info vec[] = {
{ "trace", NULL }, /* tracing? */
#endif
{ "namespace", NULL }, /* init namespace? */
{ "trace", NULL }, /* tracing? */
#endif
{ "namespace", NULL }, /* init namespace? */
{ "cwd", NULL }, /* init working dir */
#endif
{ NULL, NULL }
{ "cwd", NULL }, /* init working dir */
#endif
{ NULL, NULL }
struct option_value_info *v;
unsigned u;
static int (*f[])(const char *) = {
struct option_value_info *v;
unsigned u;
static int (*f[])(const char *) = {
_sysio_boot_tracing,
#endif
_sysio_boot_namespace,
_sysio_boot_tracing,
#endif
_sysio_boot_namespace,
_sysio_boot_cwd,
#endif
NULL /* can't happen */
_sysio_boot_cwd,
#endif
NULL /* can't happen */
*/
#define PNODES_PER_CHUNK ((8 * 1024) / sizeof(struct pnode) - 2)
*/
#define PNODES_PER_CHUNK ((8 * 1024) / sizeof(struct pnode) - 2)
/*
* Allocation information for pnodes bulk allocation.
*/
/*
* Allocation information for pnodes bulk allocation.
*/
for (i = 0; i < NAMES_TABLE_LEN; i++)
LIST_INIT(&names[i]);
for (i = 0; i < NAMES_TABLE_LEN; i++)
LIST_INIT(&names[i]);
LIST_INIT(&pnblocks);
#endif
TAILQ_INIT(&_sysio_pnodes);
LIST_INIT(&pnblocks);
#endif
TAILQ_INIT(&_sysio_pnodes);
more_pnodes()
{
size_t n;
more_pnodes()
{
size_t n;
struct pnodes_block *pnblk;
#endif
struct pnode *pno;
struct pnodes_block *pnblk;
#endif
struct pnode *pno;
pnblk = malloc(sizeof(struct pnodes_block));
pno = NULL;
if (pnblk) {
pnblk = malloc(sizeof(struct pnodes_block));
pno = NULL;
if (pnblk) {
+#ifdef _LARGEFILE64_SOURCE
#undef lseek64
extern off64_t
#undef lseek64
extern off64_t
fil = _sysio_fd_find(fd);
if (!fil)
SYSIO_INTERFACE_RETURN(-1, -EBADF);
fil = _sysio_fd_find(fd);
if (!fil)
SYSIO_INTERFACE_RETURN(-1, -EBADF);
-#if !_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
if (offset_high) {
/*
* We are using 32-bit internals. This just isn't
if (offset_high) {
/*
* We are using 32-bit internals. This just isn't
return err;
_sysio_root = mnt->mnt_root;
return err;
_sysio_root = mnt->mnt_root;
/*
* It is very annoying to have to set the current working directory.
* So... If it isn't set, make it the root now.
/*
* It is very annoying to have to set the current working directory.
* So... If it isn't set, make it the root now.
if (!parent) {
const char *icwd;
if (!parent) {
const char *icwd;
cc =
_sysio_validx(xtv, xtv_count,
iov, iov_count,
cc =
_sysio_validx(xtv, xtv_count,
iov, iov_count,
-#if _LARGEFILE64_SOURCE && defined(O_LARGEFILE)
+#if defined(_LARGEFILE64_SOURCE) && defined(O_LARGEFILE)
(fil->f_flags & O_LARGEFILE) == 0
? LONG_MAX
:
(fil->f_flags & O_LARGEFILE) == 0
? LONG_MAX
:
SYSIO_INTERFACE_RETURN(ioctx, 0);
}
SYSIO_INTERFACE_RETURN(ioctx, 0);
}
+#ifdef _LARGEFILE64_SOURCE
#undef ipread64v
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipreadv)),
SYSIO_INTERFACE_NAME(ipread64v))
#undef ipread64v
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipreadv)),
SYSIO_INTERFACE_NAME(ipread64v))
SYSIO_INTERFACE_RETURN(err ? -1 : cc, err);
}
SYSIO_INTERFACE_RETURN(err ? -1 : cc, err);
}
+#ifdef _LARGEFILE64_SOURCE
#undef pread64v
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(preadv)),
SYSIO_INTERFACE_NAME(pread64v))
#undef pread64v
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(preadv)),
SYSIO_INTERFACE_NAME(pread64v))
SYSIO_INTERFACE_RETURN(ioctx, 0);
}
SYSIO_INTERFACE_RETURN(ioctx, 0);
}
+#ifdef _LARGEFILE64_SOURCE
#undef ipread64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipread)),
SYSIO_INTERFACE_NAME(ipread64))
#undef ipread64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipread)),
SYSIO_INTERFACE_NAME(ipread64))
SYSIO_INTERFACE_RETURN(err ? -1 : cc, err);
}
SYSIO_INTERFACE_RETURN(err ? -1 : cc, err);
}
+#ifdef _LARGEFILE64_SOURCE
#undef pread64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pread)),
SYSIO_INTERFACE_NAME(pread64))
#undef pread64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pread)),
SYSIO_INTERFACE_NAME(pread64))
SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err);
}
SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err);
}
+#ifdef _LARGEFILE64_SOURCE
#undef iread64x
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ireadx)),
SYSIO_INTERFACE_NAME(iread64x))
#endif
#undef iread64x
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ireadx)),
SYSIO_INTERFACE_NAME(iread64x))
#endif
+#ifdef _LARGEFILE64_SOURCE
ioid_t
SYSIO_INTERFACE_NAME(ireadx)(int fd,
const struct iovec *iov, size_t iov_count,
ioid_t
SYSIO_INTERFACE_NAME(ireadx)(int fd,
const struct iovec *iov, size_t iov_count,
return SYSIO_INTERFACE_NAME(iowait)(ioid);
}
return SYSIO_INTERFACE_NAME(iowait)(ioid);
}
+#ifdef _LARGEFILE64_SOURCE
#undef iread64x
ssize_t
SYSIO_INTERFACE_NAME(read64x)(int fd,
#undef iread64x
ssize_t
SYSIO_INTERFACE_NAME(read64x)(int fd,
SYSIO_INTERFACE_RETURN(ioctx, 0);
}
SYSIO_INTERFACE_RETURN(ioctx, 0);
}
+#ifdef _LARGEFILE64_SOURCE
#undef ipwrite64v
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipwritev)),
SYSIO_INTERFACE_NAME(ipwrite64v))
#undef ipwrite64v
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipwritev)),
SYSIO_INTERFACE_NAME(ipwrite64v))
SYSIO_INTERFACE_RETURN(err ? -1 : cc, err);
}
SYSIO_INTERFACE_RETURN(err ? -1 : cc, err);
}
+#ifdef _LARGEFILE64_SOURCE
#undef pwrite64v
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwritev)),
SYSIO_INTERFACE_NAME(pwrite64v))
#undef pwrite64v
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwritev)),
SYSIO_INTERFACE_NAME(pwrite64v))
SYSIO_INTERFACE_RETURN(ioctx, 0);
}
SYSIO_INTERFACE_RETURN(ioctx, 0);
}
+#ifdef _LARGEFILE64_SOURCE
#undef ipwrite64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipwrite)),
SYSIO_INTERFACE_NAME(ipwrite64))
#undef ipwrite64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipwrite)),
SYSIO_INTERFACE_NAME(ipwrite64))
SYSIO_INTERFACE_RETURN(err ? -1 : cc, err);
}
SYSIO_INTERFACE_RETURN(err ? -1 : cc, err);
}
+#ifdef _LARGEFILE64_SOURCE
#undef pwrite64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwrite)),
SYSIO_INTERFACE_NAME(pwrite64))
#undef pwrite64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwrite)),
SYSIO_INTERFACE_NAME(pwrite64))
SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err);
}
SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err);
}
+#ifdef _LARGEFILE64_SOURCE
#undef iwrite64x
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(iwritex)),
SYSIO_INTERFACE_NAME(iwrite64x))
#endif
#undef iwrite64x
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(iwritex)),
SYSIO_INTERFACE_NAME(iwrite64x))
#endif
+#ifdef _LARGEFILE64_SOURCE
ioid_t
SYSIO_INTERFACE_NAME(iwritex)(int fd,
const struct iovec *iov, size_t iov_count,
ioid_t
SYSIO_INTERFACE_NAME(iwritex)(int fd,
const struct iovec *iov, size_t iov_count,
return SYSIO_INTERFACE_NAME(iowait)(ioid);
}
return SYSIO_INTERFACE_NAME(iowait)(ioid);
}
+#ifdef _LARGEFILE64_SOURCE
#undef write64x
ssize_t
SYSIO_INTERFACE_NAME(write64x)(int fd,
#undef write64x
ssize_t
SYSIO_INTERFACE_NAME(write64x)(int fd,
#define _STAT_VER 0
#endif
#define _STAT_VER 0
#endif
+#ifdef _LARGEFILE64_SOURCE
static void
convstat(struct stat64 *st64_buf, struct stat *st_buf)
{
static void
convstat(struct stat64 *st64_buf, struct stat *st_buf)
{
struct file *fil;
int err;
struct intnl_stat *buf;
struct file *fil;
int err;
struct intnl_stat *buf;
+#ifdef _LARGEFILE64_SOURCE
struct stat64 st64;
#endif
SYSIO_INTERFACE_DISPLAY_BLOCK;
struct stat64 st64;
#endif
SYSIO_INTERFACE_DISPLAY_BLOCK;
err = -EBADF;
goto out;
}
err = -EBADF;
goto out;
}
+#ifdef _LARGEFILE64_SOURCE
buf = &st64;
#else
buf = __stat_buf;
buf = &st64;
#else
buf = __stat_buf;
*/
err =
fil->f_ino->i_ops.inop_getattr(NULL, fil->f_ino, buf);
*/
err =
fil->f_ino->i_ops.inop_getattr(NULL, fil->f_ino, buf);
+#ifdef _LARGEFILE64_SOURCE
if (!err)
convstat(buf, __stat_buf);
#endif
if (!err)
convstat(buf, __stat_buf);
#endif
* the inode are always correct or refresh them in the lookup, above.
*/
ino = pno->p_base->pb_ino;
* the inode are always correct or refresh them in the lookup, above.
*/
ino = pno->p_base->pb_ino;
+#ifdef _LARGEFILE64_SOURCE
convstat(&ino->i_stbuf, __stat_buf);
#else
(void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat));
convstat(&ino->i_stbuf, __stat_buf);
#else
(void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat));
* the inode are always correct or refresh them in the lookup, above.
*/
ino = pno->p_base->pb_ino;
* the inode are always correct or refresh them in the lookup, above.
*/
ino = pno->p_base->pb_ino;
+#ifdef _LARGEFILE64_SOURCE
convstat(&ino->i_stbuf, __stat_buf);
#else
(void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat));
convstat(&ino->i_stbuf, __stat_buf);
#else
(void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat));
SYSIO_INTERFACE_RETURN(err ? -1 : 0, err);
}
SYSIO_INTERFACE_RETURN(err ? -1 : 0, err);
}
+#ifdef _LARGEFILE64_SOURCE
#undef truncate64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(truncate)),
SYSIO_INTERFACE_NAME(truncate64))
#undef truncate64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(truncate)),
SYSIO_INTERFACE_NAME(truncate64))
SYSIO_INTERFACE_RETURN(err ? -1 : 0, err);
}
SYSIO_INTERFACE_RETURN(err ? -1 : 0, err);
}
+#ifdef _LARGEFILE64_SOURCE
#undef ftruncate64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ftruncate)),
SYSIO_INTERFACE_NAME(ftruncate64))
#undef ftruncate64
sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ftruncate)),
SYSIO_INTERFACE_NAME(ftruncate64))
err = drv_init_all();
if (err)
return err;
err = drv_init_all();
if (err)
return err;
err = _sysio_boot("namespace", arg);
if (err)
return err;
err = _sysio_boot("namespace", arg);
if (err)
return err;
/*
* Current working directory.
*/
/*
* Current working directory.
*/