4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-20 05:19:21 +08:00

* dir.cc: Change __off32_t to _off_t and __off64_t to _off64_t

throughout.
	* fhandler.cc: Ditto.
	* fhandler.h: Ditto.
	* fhandler_clipboard.cc: Ditto.
	* fhandler_disk_file.cc: Ditto.
	* fhandler_dsp.cc: Ditto.
	* fhandler_floppy.cc: Ditto.
	* fhandler_mem.cc: Ditto.
	* fhandler_proc.cc: Ditto.
	* fhandler_process.cc: Ditto.
	* fhandler_random.cc: Ditto.
	* fhandler_registry.cc: Ditto.
	* fhandler_tape.cc: Ditto.
	* fhandler_termios.cc: Ditto.
	* fhandler_virtual.cc: Ditto.
	* fhandler_zero.cc: Ditto.
	* mmap.cc: Ditto.
	* pipe.cc: Ditto.
	* syscalls.cc: Ditto.
	* winsup.h: Ditto.
	* include/cygwin/stat.h: Ditto.
	* include/cygwin/types.h: Ditto.  Remove definition of __off32_t
	and __off64_t.
This commit is contained in:
Corinna Vinschen 2003-04-01 16:11:41 +00:00
parent 5340a2ed6d
commit 1727fba007
23 changed files with 178 additions and 153 deletions

View File

@ -1,3 +1,30 @@
2003-04-01 Corinna Vinschen <corinna@vinschen.de>
* dir.cc: Change __off32_t to _off_t and __off64_t to _off64_t
throughout.
* fhandler.cc: Ditto.
* fhandler.h: Ditto.
* fhandler_clipboard.cc: Ditto.
* fhandler_disk_file.cc: Ditto.
* fhandler_dsp.cc: Ditto.
* fhandler_floppy.cc: Ditto.
* fhandler_mem.cc: Ditto.
* fhandler_proc.cc: Ditto.
* fhandler_process.cc: Ditto.
* fhandler_random.cc: Ditto.
* fhandler_registry.cc: Ditto.
* fhandler_tape.cc: Ditto.
* fhandler_termios.cc: Ditto.
* fhandler_virtual.cc: Ditto.
* fhandler_zero.cc: Ditto.
* mmap.cc: Ditto.
* pipe.cc: Ditto.
* syscalls.cc: Ditto.
* winsup.h: Ditto.
* include/cygwin/stat.h: Ditto.
* include/cygwin/types.h: Ditto. Remove definition of __off32_t
and __off64_t.
2003-03-31 Christopher Faylor <cgf@redhat.com> 2003-03-31 Christopher Faylor <cgf@redhat.com>
* exceptions.cc (setup_handler): Make sure winapi lock is released when * exceptions.cc (setup_handler): Make sure winapi lock is released when

View File

@ -149,7 +149,7 @@ readdir (DIR *dir)
return res; return res;
} }
extern "C" __off64_t extern "C" _off64_t
telldir64 (DIR *dir) telldir64 (DIR *dir)
{ {
if (check_null_invalid_struct_errno (dir)) if (check_null_invalid_struct_errno (dir))
@ -161,14 +161,14 @@ telldir64 (DIR *dir)
} }
/* telldir */ /* telldir */
extern "C" __off32_t extern "C" _off_t
telldir (DIR *dir) telldir (DIR *dir)
{ {
return telldir64 (dir); return telldir64 (dir);
} }
extern "C" void extern "C" void
seekdir64 (DIR *dir, __off64_t loc) seekdir64 (DIR *dir, _off64_t loc)
{ {
if (check_null_invalid_struct_errno (dir)) if (check_null_invalid_struct_errno (dir))
return; return;
@ -180,9 +180,9 @@ seekdir64 (DIR *dir, __off64_t loc)
/* seekdir */ /* seekdir */
extern "C" void extern "C" void
seekdir (DIR *dir, __off32_t loc) seekdir (DIR *dir, _off_t loc)
{ {
seekdir64 (dir, (__off64_t)loc); seekdir64 (dir, (_off64_t)loc);
} }
/* rewinddir: POSIX 5.1.2.1 */ /* rewinddir: POSIX 5.1.2.1 */

View File

@ -824,10 +824,10 @@ fhandler_base::writev (const struct iovec *const iov, const int iovcnt,
return write (buf, tot); return write (buf, tot);
} }
__off64_t _off64_t
fhandler_base::lseek (__off64_t offset, int whence) fhandler_base::lseek (_off64_t offset, int whence)
{ {
__off64_t res; _off64_t res;
/* 9x/Me doesn't support 64bit offsets. We trap that here and return /* 9x/Me doesn't support 64bit offsets. We trap that here and return
EINVAL. It doesn't make sense to simulate bigger offsets by a EINVAL. It doesn't make sense to simulate bigger offsets by a
@ -838,7 +838,7 @@ fhandler_base::lseek (__off64_t offset, int whence)
{ {
debug_printf ("Win9x, offset not 32 bit."); debug_printf ("Win9x, offset not 32 bit.");
set_errno (EINVAL); set_errno (EINVAL);
return (__off64_t)-1; return (_off64_t)-1;
} }
/* Seeks on text files is tough, we rewind and read till we get to the /* Seeks on text files is tough, we rewind and read till we get to the
@ -1274,7 +1274,7 @@ fhandler_base::readdir (DIR *)
return NULL; return NULL;
} }
__off64_t _off64_t
fhandler_base::telldir (DIR *) fhandler_base::telldir (DIR *)
{ {
set_errno (ENOTDIR); set_errno (ENOTDIR);
@ -1282,7 +1282,7 @@ fhandler_base::telldir (DIR *)
} }
void void
fhandler_base::seekdir (DIR *, __off64_t) fhandler_base::seekdir (DIR *, _off64_t)
{ {
set_errno (ENOTDIR); set_errno (ENOTDIR);
return; return;

View File

@ -310,13 +310,13 @@ class fhandler_base
virtual int write (const void *ptr, size_t len); virtual int write (const void *ptr, size_t len);
virtual ssize_t readv (const struct iovec *, int iovcnt, ssize_t tot = -1); virtual ssize_t readv (const struct iovec *, int iovcnt, ssize_t tot = -1);
virtual ssize_t writev (const struct iovec *, int iovcnt, ssize_t tot = -1); virtual ssize_t writev (const struct iovec *, int iovcnt, ssize_t tot = -1);
virtual __off64_t lseek (__off64_t offset, int whence); virtual _off64_t lseek (_off64_t offset, int whence);
virtual int lock (int, struct flock *); virtual int lock (int, struct flock *);
virtual void dump (); virtual void dump ();
virtual int dup (fhandler_base *child); virtual int dup (fhandler_base *child);
virtual HANDLE mmap (caddr_t *addr, size_t len, DWORD access, virtual HANDLE mmap (caddr_t *addr, size_t len, DWORD access,
int flags, __off64_t off); int flags, _off64_t off);
virtual int munmap (HANDLE h, caddr_t addr, size_t len); virtual int munmap (HANDLE h, caddr_t addr, size_t len);
virtual int msync (HANDLE h, caddr_t addr, size_t len, int flags); virtual int msync (HANDLE h, caddr_t addr, size_t len, int flags);
virtual BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset, virtual BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset,
@ -369,8 +369,8 @@ class fhandler_base
virtual void set_eof () {} virtual void set_eof () {}
virtual DIR *opendir (path_conv& pc); virtual DIR *opendir (path_conv& pc);
virtual dirent *readdir (DIR *); virtual dirent *readdir (DIR *);
virtual __off64_t telldir (DIR *); virtual _off64_t telldir (DIR *);
virtual void seekdir (DIR *, __off64_t); virtual void seekdir (DIR *, _off64_t);
virtual void rewinddir (DIR *); virtual void rewinddir (DIR *);
virtual int closedir (DIR *); virtual int closedir (DIR *);
}; };
@ -424,7 +424,7 @@ class fhandler_socket: public fhandler_base
int ioctl (unsigned int cmd, void *); int ioctl (unsigned int cmd, void *);
int fcntl (int cmd, void *); int fcntl (int cmd, void *);
__off64_t lseek (__off64_t, int) { return 0; } _off64_t lseek (_off64_t, int) { return 0; }
int shutdown (int how); int shutdown (int how);
int close (); int close ();
void hclose (HANDLE) {close ();} void hclose (HANDLE) {close ();}
@ -462,7 +462,7 @@ class fhandler_pipe: public fhandler_base
unsigned id; unsigned id;
public: public:
fhandler_pipe (DWORD devtype); fhandler_pipe (DWORD devtype);
__off64_t lseek (__off64_t offset, int whence); _off64_t lseek (_off64_t offset, int whence);
select_record *select_read (select_record *s); select_record *select_read (select_record *s);
select_record *select_write (select_record *s); select_record *select_write (select_record *s);
select_record *select_except (select_record *s); select_record *select_except (select_record *s);
@ -537,7 +537,7 @@ class fhandler_dev_floppy: public fhandler_dev_raw
virtual int open (path_conv *, int flags, mode_t mode = 0); virtual int open (path_conv *, int flags, mode_t mode = 0);
virtual int close (void); virtual int close (void);
virtual __off64_t lseek (__off64_t offset, int whence); virtual _off64_t lseek (_off64_t offset, int whence);
virtual int ioctl (unsigned int cmd, void *buf); virtual int ioctl (unsigned int cmd, void *buf);
}; };
@ -560,7 +560,7 @@ class fhandler_dev_tape: public fhandler_dev_raw
virtual int open (path_conv *, int flags, mode_t mode = 0); virtual int open (path_conv *, int flags, mode_t mode = 0);
virtual int close (void); virtual int close (void);
virtual __off64_t lseek (__off64_t offset, int whence); virtual _off64_t lseek (_off64_t offset, int whence);
virtual int __stdcall fstat (struct __stat64 *buf, path_conv *) __attribute__ ((regparm (3))); virtual int __stdcall fstat (struct __stat64 *buf, path_conv *) __attribute__ ((regparm (3)));
@ -607,15 +607,15 @@ class fhandler_disk_file: public fhandler_base
int __stdcall fstat_by_handle (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3))); int __stdcall fstat_by_handle (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3)));
int __stdcall fstat_by_name (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3))); int __stdcall fstat_by_name (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3)));
HANDLE mmap (caddr_t *addr, size_t len, DWORD access, int flags, __off64_t off); HANDLE mmap (caddr_t *addr, size_t len, DWORD access, int flags, _off64_t off);
int munmap (HANDLE h, caddr_t addr, size_t len); int munmap (HANDLE h, caddr_t addr, size_t len);
int msync (HANDLE h, caddr_t addr, size_t len, int flags); int msync (HANDLE h, caddr_t addr, size_t len, int flags);
BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset, BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset,
DWORD size, void *address); DWORD size, void *address);
DIR *opendir (path_conv& pc); DIR *opendir (path_conv& pc);
struct dirent *readdir (DIR *); struct dirent *readdir (DIR *);
__off64_t telldir (DIR *); _off64_t telldir (DIR *);
void seekdir (DIR *, __off64_t); void seekdir (DIR *, _off64_t);
void rewinddir (DIR *); void rewinddir (DIR *);
int closedir (DIR *); int closedir (DIR *);
}; };
@ -631,8 +631,8 @@ class fhandler_cygdrive: public fhandler_disk_file
fhandler_cygdrive (int unit); fhandler_cygdrive (int unit);
DIR *opendir (path_conv& pc); DIR *opendir (path_conv& pc);
struct dirent *readdir (DIR *); struct dirent *readdir (DIR *);
__off64_t telldir (DIR *); _off64_t telldir (DIR *);
void seekdir (DIR *, __off64_t); void seekdir (DIR *, _off64_t);
void rewinddir (DIR *); void rewinddir (DIR *);
int closedir (DIR *); int closedir (DIR *);
int __stdcall fstat (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3))); int __stdcall fstat (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3)));
@ -668,7 +668,7 @@ class fhandler_serial: public fhandler_base
int ioctl (unsigned int cmd, void *); int ioctl (unsigned int cmd, void *);
int tcsetattr (int a, const struct termios *t); int tcsetattr (int a, const struct termios *t);
int tcgetattr (struct termios *t); int tcgetattr (struct termios *t);
__off64_t lseek (__off64_t, int) { return 0; } _off64_t lseek (_off64_t, int) { return 0; }
int tcflush (int); int tcflush (int);
void dump (); void dump ();
int is_tty () { return 1; } int is_tty () { return 1; }
@ -719,7 +719,7 @@ class fhandler_termios: public fhandler_base
void fixup_after_fork (HANDLE); void fixup_after_fork (HANDLE);
void fixup_after_exec (HANDLE parent) { fixup_after_fork (parent); } void fixup_after_exec (HANDLE parent) { fixup_after_fork (parent); }
void echo_erase (int force = 0); void echo_erase (int force = 0);
virtual __off64_t lseek (__off64_t, int); virtual _off64_t lseek (_off64_t, int);
}; };
enum ansi_intensity enum ansi_intensity
@ -911,7 +911,7 @@ class fhandler_tty_slave: public fhandler_tty_common
int dup (fhandler_base *child); int dup (fhandler_base *child);
void fixup_after_fork (HANDLE parent); void fixup_after_fork (HANDLE parent);
__off64_t lseek (__off64_t, int) { return 0; } _off64_t lseek (_off64_t, int) { return 0; }
select_record *select_read (select_record *s); select_record *select_read (select_record *s);
int cygserver_attach_tty (HANDLE*, HANDLE*); int cygserver_attach_tty (HANDLE*, HANDLE*);
}; };
@ -938,7 +938,7 @@ class fhandler_pty_master: public fhandler_tty_common
int tcflush (int); int tcflush (int);
int ioctl (unsigned int cmd, void *); int ioctl (unsigned int cmd, void *);
__off64_t lseek (__off64_t, int) { return 0; } _off64_t lseek (_off64_t, int) { return 0; }
char *ptsname (); char *ptsname ();
void set_close_on_exec (int val); void set_close_on_exec (int val);
@ -977,7 +977,7 @@ class fhandler_dev_zero: public fhandler_base
int open (path_conv *, int flags, mode_t mode = 0); int open (path_conv *, int flags, mode_t mode = 0);
int write (const void *ptr, size_t len); int write (const void *ptr, size_t len);
void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
__off64_t lseek (__off64_t offset, int whence); _off64_t lseek (_off64_t offset, int whence);
void dump (); void dump ();
}; };
@ -999,7 +999,7 @@ class fhandler_dev_random: public fhandler_base
int open (path_conv *, int flags, mode_t mode = 0); int open (path_conv *, int flags, mode_t mode = 0);
int write (const void *ptr, size_t len); int write (const void *ptr, size_t len);
void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
__off64_t lseek (__off64_t offset, int whence); _off64_t lseek (_off64_t offset, int whence);
int close (void); int close (void);
int dup (fhandler_base *child); int dup (fhandler_base *child);
@ -1011,7 +1011,7 @@ class fhandler_dev_mem: public fhandler_base
protected: protected:
int unit; int unit;
DWORD mem_size; DWORD mem_size;
__off64_t pos; _off64_t pos;
public: public:
fhandler_dev_mem (int unit); fhandler_dev_mem (int unit);
@ -1020,12 +1020,12 @@ class fhandler_dev_mem: public fhandler_base
int open (path_conv *, int flags, mode_t mode = 0); int open (path_conv *, int flags, mode_t mode = 0);
int write (const void *ptr, size_t ulen); int write (const void *ptr, size_t ulen);
void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
__off64_t lseek (__off64_t offset, int whence); _off64_t lseek (_off64_t offset, int whence);
int close (void); int close (void);
int __stdcall fstat (struct __stat64 *buf, path_conv *) __attribute__ ((regparm (3))); int __stdcall fstat (struct __stat64 *buf, path_conv *) __attribute__ ((regparm (3)));
int dup (fhandler_base *child); int dup (fhandler_base *child);
HANDLE mmap (caddr_t *addr, size_t len, DWORD access, int flags, __off64_t off); HANDLE mmap (caddr_t *addr, size_t len, DWORD access, int flags, _off64_t off);
int munmap (HANDLE h, caddr_t addr, size_t len); int munmap (HANDLE h, caddr_t addr, size_t len);
int msync (HANDLE h, caddr_t addr, size_t len, int flags); int msync (HANDLE h, caddr_t addr, size_t len, int flags);
BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset, BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset,
@ -1042,7 +1042,7 @@ class fhandler_dev_clipboard: public fhandler_base
int open (path_conv *, int flags, mode_t mode = 0); int open (path_conv *, int flags, mode_t mode = 0);
int write (const void *ptr, size_t len); int write (const void *ptr, size_t len);
void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
__off64_t lseek (__off64_t offset, int whence); _off64_t lseek (_off64_t offset, int whence);
int close (void); int close (void);
int dup (fhandler_base *child); int dup (fhandler_base *child);
@ -1050,7 +1050,7 @@ class fhandler_dev_clipboard: public fhandler_base
void dump (); void dump ();
private: private:
__off64_t pos; _off64_t pos;
void *membuffer; void *membuffer;
size_t msize; size_t msize;
bool eof; bool eof;
@ -1068,7 +1068,7 @@ class fhandler_windows: public fhandler_base
int write (const void *ptr, size_t len); int write (const void *ptr, size_t len);
void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
int ioctl (unsigned int cmd, void *); int ioctl (unsigned int cmd, void *);
__off64_t lseek (__off64_t, int) { return 0; } _off64_t lseek (_off64_t, int) { return 0; }
int close (void) { return 0; } int close (void) { return 0; }
void set_close_on_exec (int val); void set_close_on_exec (int val);
@ -1094,7 +1094,7 @@ class fhandler_dev_dsp : public fhandler_base
int write (const void *ptr, size_t len); int write (const void *ptr, size_t len);
void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
int ioctl (unsigned int cmd, void *); int ioctl (unsigned int cmd, void *);
__off64_t lseek (__off64_t, int); _off64_t lseek (_off64_t, int);
int close (void); int close (void);
int dup (fhandler_base * child); int dup (fhandler_base * child);
void dump (void); void dump (void);
@ -1106,8 +1106,8 @@ class fhandler_virtual : public fhandler_base
protected: protected:
char *filebuf; char *filebuf;
size_t bufalloc; size_t bufalloc;
__off64_t filesize; _off64_t filesize;
__off64_t position; _off64_t position;
int fileid; // unique within each class int fileid; // unique within each class
public: public:
@ -1116,13 +1116,13 @@ class fhandler_virtual : public fhandler_base
virtual int exists(); virtual int exists();
DIR *opendir (path_conv& pc); DIR *opendir (path_conv& pc);
__off64_t telldir (DIR *); _off64_t telldir (DIR *);
void seekdir (DIR *, __off64_t); void seekdir (DIR *, _off64_t);
void rewinddir (DIR *); void rewinddir (DIR *);
int closedir (DIR *); int closedir (DIR *);
int write (const void *ptr, size_t len); int write (const void *ptr, size_t len);
void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
__off64_t lseek (__off64_t, int); _off64_t lseek (_off64_t, int);
int dup (fhandler_base * child); int dup (fhandler_base * child);
int open (path_conv *, int flags, mode_t mode = 0); int open (path_conv *, int flags, mode_t mode = 0);
int close (void); int close (void);
@ -1153,8 +1153,8 @@ class fhandler_registry: public fhandler_proc
fhandler_registry (); fhandler_registry ();
int exists(); int exists();
struct dirent *readdir (DIR *); struct dirent *readdir (DIR *);
__off64_t telldir (DIR *); _off64_t telldir (DIR *);
void seekdir (DIR *, __off64_t); void seekdir (DIR *, _off64_t);
void rewinddir (DIR *); void rewinddir (DIR *);
int closedir (DIR *); int closedir (DIR *);

View File

@ -244,8 +244,8 @@ fhandler_dev_clipboard::read (void *ptr, size_t& len)
} }
} }
__off64_t _off64_t
fhandler_dev_clipboard::lseek (__off64_t offset, int whence) fhandler_dev_clipboard::lseek (_off64_t offset, int whence)
{ {
/* On reads we check this at read time, not seek time. /* On reads we check this at read time, not seek time.
* On writes we use this to decide how to write - empty and write, or open, copy, empty * On writes we use this to decide how to write - empty and write, or open, copy, empty

View File

@ -230,7 +230,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
to_timestruc_t (&ftLastWriteTime, &buf->st_mtim); to_timestruc_t (&ftLastWriteTime, &buf->st_mtim);
to_timestruc_t (&ftCreationTime, &buf->st_ctim); to_timestruc_t (&ftCreationTime, &buf->st_ctim);
buf->st_dev = pc->volser (); buf->st_dev = pc->volser ();
buf->st_size = ((__off64_t)nFileSizeHigh << 32) + nFileSizeLow; buf->st_size = ((_off64_t)nFileSizeHigh << 32) + nFileSizeLow;
/* Unfortunately the count of 2 confuses `find (1)' command. So /* Unfortunately the count of 2 confuses `find (1)' command. So
let's try it with `1' as link count. */ let's try it with `1' as link count. */
if (pc->isdir () && !pc->isremote () && nNumberOfLinks == 1) if (pc->isdir () && !pc->isremote () && nNumberOfLinks == 1)
@ -269,7 +269,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
/* On systems supporting compressed (and sparsed) files, /* On systems supporting compressed (and sparsed) files,
GetCompressedFileSize() returns the actual amount of GetCompressedFileSize() returns the actual amount of
bytes allocated on disk. */ bytes allocated on disk. */
buf->st_blocks = (((__off64_t)nFileSizeHigh << 32) buf->st_blocks = (((_off64_t)nFileSizeHigh << 32)
+ nFileSizeLow + S_BLKSIZE - 1) / S_BLKSIZE; + nFileSizeLow + S_BLKSIZE - 1) / S_BLKSIZE;
else else
/* Just compute no. of blocks from file size. */ /* Just compute no. of blocks from file size. */
@ -457,10 +457,10 @@ fhandler_disk_file::close ()
int int
fhandler_disk_file::lock (int cmd, struct flock *fl) fhandler_disk_file::lock (int cmd, struct flock *fl)
{ {
__off64_t win32_start; _off64_t win32_start;
int win32_len; int win32_len;
DWORD win32_upper; DWORD win32_upper;
__off64_t startpos; _off64_t startpos;
/* /*
* We don't do getlck calls yet. * We don't do getlck calls yet.
@ -494,7 +494,7 @@ fhandler_disk_file::lock (int cmd, struct flock *fl)
__seterrno (); __seterrno ();
return -1; return -1;
} }
startpos = ((__off64_t)finfo.nFileSizeHigh << 32) startpos = ((_off64_t)finfo.nFileSizeHigh << 32)
+ finfo.nFileSizeLow; + finfo.nFileSizeLow;
break; break;
} }
@ -715,14 +715,14 @@ fhandler_disk_file::readdir (DIR *dir)
return res; return res;
} }
__off64_t _off64_t
fhandler_disk_file::telldir (DIR *dir) fhandler_disk_file::telldir (DIR *dir)
{ {
return dir->__d_position; return dir->__d_position;
} }
void void
fhandler_disk_file::seekdir (DIR *dir, __off64_t loc) fhandler_disk_file::seekdir (DIR *dir, _off64_t loc)
{ {
rewinddir (dir); rewinddir (dir);
while (loc > dir->__d_position) while (loc > dir->__d_position)
@ -829,14 +829,14 @@ fhandler_cygdrive::readdir (DIR *dir)
return dir->__d_dirent; return dir->__d_dirent;
} }
__off64_t _off64_t
fhandler_cygdrive::telldir (DIR *dir) fhandler_cygdrive::telldir (DIR *dir)
{ {
return fhandler_disk_file::telldir (dir); return fhandler_disk_file::telldir (dir);
} }
void void
fhandler_cygdrive::seekdir (DIR *dir, __off64_t loc) fhandler_cygdrive::seekdir (DIR *dir, _off64_t loc)
{ {
if (!iscygdrive_root ()) if (!iscygdrive_root ())
return fhandler_disk_file::seekdir (dir, loc); return fhandler_disk_file::seekdir (dir, loc);

View File

@ -487,8 +487,8 @@ fhandler_dev_dsp::read (void *ptr, size_t& len)
return; return;
} }
__off64_t _off64_t
fhandler_dev_dsp::lseek (__off64_t offset, int whence) fhandler_dev_dsp::lseek (_off64_t offset, int whence)
{ {
return 0; return 0;
} }

View File

@ -79,16 +79,16 @@ fhandler_dev_floppy::close (void)
return fhandler_dev_raw::close (); return fhandler_dev_raw::close ();
} }
__off64_t _off64_t
fhandler_dev_floppy::lseek (__off64_t offset, int whence) fhandler_dev_floppy::lseek (_off64_t offset, int whence)
{ {
int ret; int ret;
char buf[512]; char buf[512];
__off64_t drive_size = 0; _off64_t drive_size = 0;
__off64_t lloffset = offset; _off64_t lloffset = offset;
__off64_t current_position; _off64_t current_position;
__off64_t sector_aligned_offset; _off64_t sector_aligned_offset;
__off64_t bytes_left; _off64_t bytes_left;
DWORD low; DWORD low;
LONG high = 0; LONG high = 0;
@ -142,7 +142,7 @@ fhandler_dev_floppy::lseek (__off64_t offset, int whence)
__seterrno (); __seterrno ();
return -1; return -1;
} }
current_position = low + ((__off64_t) high << 32); current_position = low + ((_off64_t) high << 32);
if (is_writing) if (is_writing)
current_position += devbufend - devbufstart; current_position += devbufend - devbufstart;
else else
@ -195,8 +195,8 @@ fhandler_dev_floppy::ioctl (unsigned int cmd, void *buf)
DISK_GEOMETRY di; DISK_GEOMETRY di;
PARTITION_INFORMATION pi; PARTITION_INFORMATION pi;
DWORD bytes_read; DWORD bytes_read;
__off64_t drive_size = 0; _off64_t drive_size = 0;
__off64_t start = 0; _off64_t start = 0;
switch (cmd) switch (cmd)
{ {
case HDIO_GETGEO: case HDIO_GETGEO:
@ -271,7 +271,7 @@ fhandler_dev_floppy::ioctl (unsigned int cmd, void *buf)
if (cmd == BLKGETSIZE) if (cmd == BLKGETSIZE)
*(long *)buf = drive_size >> 9UL; *(long *)buf = drive_size >> 9UL;
else else
*(__off64_t *)buf = drive_size; *(_off64_t *)buf = drive_size;
return 0; return 0;
} }
case BLKRRPART: case BLKRRPART:

View File

@ -236,8 +236,8 @@ fhandler_dev_mem::close (void)
return fhandler_base::close (); return fhandler_base::close ();
} }
__off64_t _off64_t
fhandler_dev_mem::lseek (__off64_t offset, int whence) fhandler_dev_mem::lseek (_off64_t offset, int whence)
{ {
switch (whence) switch (whence)
{ {
@ -270,7 +270,7 @@ fhandler_dev_mem::lseek (__off64_t offset, int whence)
HANDLE HANDLE
fhandler_dev_mem::mmap (caddr_t *addr, size_t len, DWORD access, fhandler_dev_mem::mmap (caddr_t *addr, size_t len, DWORD access,
int flags, __off64_t off) int flags, _off64_t off)
{ {
if (off >= mem_size if (off >= mem_size
|| (DWORD) len >= mem_size || (DWORD) len >= mem_size

View File

@ -79,11 +79,11 @@ static const DWORD proc_fhandlers[PROC_LINK_COUNT] = {
const char proc[] = "/proc"; const char proc[] = "/proc";
const int proc_len = sizeof (proc) - 1; const int proc_len = sizeof (proc) - 1;
static __off64_t format_proc_meminfo (char *destbuf, size_t maxsize); static _off64_t format_proc_meminfo (char *destbuf, size_t maxsize);
static __off64_t format_proc_stat (char *destbuf, size_t maxsize); static _off64_t format_proc_stat (char *destbuf, size_t maxsize);
static __off64_t format_proc_uptime (char *destbuf, size_t maxsize); static _off64_t format_proc_uptime (char *destbuf, size_t maxsize);
static __off64_t format_proc_cpuinfo (char *destbuf, size_t maxsize); static _off64_t format_proc_cpuinfo (char *destbuf, size_t maxsize);
static __off64_t format_proc_partitions (char *destbuf, size_t maxsize); static _off64_t format_proc_partitions (char *destbuf, size_t maxsize);
/* Auxillary function that returns the fhandler associated with the given path /* Auxillary function that returns the fhandler associated with the given path
this is where it would be nice to have pattern matching in C - polymorphism this is where it would be nice to have pattern matching in C - polymorphism
@ -387,7 +387,7 @@ fhandler_proc::fill_filebuf ()
return true; return true;
} }
static __off64_t static _off64_t
format_proc_meminfo (char *destbuf, size_t maxsize) format_proc_meminfo (char *destbuf, size_t maxsize)
{ {
unsigned long mem_total = 0UL, mem_free = 0UL, swap_total = 0UL, unsigned long mem_total = 0UL, mem_free = 0UL, swap_total = 0UL,
@ -417,7 +417,7 @@ format_proc_meminfo (char *destbuf, size_t maxsize)
swap_total >> 10, swap_free >> 10); swap_total >> 10, swap_free >> 10);
} }
static __off64_t static _off64_t
format_proc_uptime (char *destbuf, size_t maxsize) format_proc_uptime (char *destbuf, size_t maxsize)
{ {
unsigned long long uptime = 0ULL, idle_time = 0ULL; unsigned long long uptime = 0ULL, idle_time = 0ULL;
@ -453,7 +453,7 @@ out:
idle_time / 100, long (idle_time % 100)); idle_time / 100, long (idle_time % 100));
} }
static __off64_t static _off64_t
format_proc_stat (char *destbuf, size_t maxsize) format_proc_stat (char *destbuf, size_t maxsize)
{ {
unsigned long long user_time = 0ULL, kernel_time = 0ULL, idle_time = 0ULL; unsigned long long user_time = 0ULL, kernel_time = 0ULL, idle_time = 0ULL;
@ -581,7 +581,7 @@ can_set_flag (unsigned flag)
return ((r1 ^ r2) & flag) != 0; return ((r1 ^ r2) & flag) != 0;
} }
static __off64_t static _off64_t
format_proc_cpuinfo (char *destbuf, size_t maxsize) format_proc_cpuinfo (char *destbuf, size_t maxsize)
{ {
SYSTEM_INFO siSystemInfo; SYSTEM_INFO siSystemInfo;
@ -858,7 +858,7 @@ format_proc_cpuinfo (char *destbuf, size_t maxsize)
#undef read_value #undef read_value
static __off64_t static _off64_t
format_proc_partitions (char *destbuf, size_t maxsize) format_proc_partitions (char *destbuf, size_t maxsize)
{ {
char *bufptr = destbuf; char *bufptr = destbuf;

View File

@ -67,9 +67,9 @@ static const char * const process_listing[] =
static const int PROCESS_LINK_COUNT = static const int PROCESS_LINK_COUNT =
(sizeof (process_listing) / sizeof (const char *)) - 1; (sizeof (process_listing) / sizeof (const char *)) - 1;
static __off64_t format_process_stat (_pinfo *p, char *destbuf, size_t maxsize); static _off64_t format_process_stat (_pinfo *p, char *destbuf, size_t maxsize);
static __off64_t format_process_status (_pinfo *p, char *destbuf, size_t maxsize); static _off64_t format_process_status (_pinfo *p, char *destbuf, size_t maxsize);
static __off64_t format_process_statm (_pinfo *p, char *destbuf, size_t maxsize); static _off64_t format_process_statm (_pinfo *p, char *destbuf, size_t maxsize);
static int get_process_state (DWORD dwProcessId); static int get_process_state (DWORD dwProcessId);
static bool get_mem_values (DWORD dwProcessId, unsigned long *vmsize, static bool get_mem_values (DWORD dwProcessId, unsigned long *vmsize,
unsigned long *vmrss, unsigned long *vmtext, unsigned long *vmrss, unsigned long *vmtext,
@ -365,7 +365,7 @@ fhandler_process::fill_filebuf ()
return true; return true;
} }
static __off64_t static _off64_t
format_process_stat (_pinfo *p, char *destbuf, size_t maxsize) format_process_stat (_pinfo *p, char *destbuf, size_t maxsize)
{ {
char cmd[MAX_PATH]; char cmd[MAX_PATH];
@ -500,7 +500,7 @@ format_process_stat (_pinfo *p, char *destbuf, size_t maxsize)
); );
} }
static __off64_t static _off64_t
format_process_status (_pinfo *p, char *destbuf, size_t maxsize) format_process_status (_pinfo *p, char *destbuf, size_t maxsize)
{ {
char cmd[MAX_PATH]; char cmd[MAX_PATH];
@ -593,7 +593,7 @@ format_process_status (_pinfo *p, char *destbuf, size_t maxsize)
); );
} }
static __off64_t static _off64_t
format_process_statm (_pinfo *p, char *destbuf, size_t maxsize) format_process_statm (_pinfo *p, char *destbuf, size_t maxsize)
{ {
unsigned long vmsize = 0UL, vmrss = 0UL, vmtext = 0UL, vmdata = 0UL, unsigned long vmsize = 0UL, vmrss = 0UL, vmtext = 0UL, vmdata = 0UL,

View File

@ -139,8 +139,8 @@ fhandler_dev_random::read (void *ptr, size_t& len)
(ssize_t) len = -1; (ssize_t) len = -1;
} }
__off64_t _off64_t
fhandler_dev_random::lseek (__off64_t, int) fhandler_dev_random::lseek (_off64_t, int)
{ {
return 0; return 0;
} }

View File

@ -32,8 +32,8 @@ static const int registry_len = sizeof ("registry") - 1;
* the bottom 16 bits are the absolute position and the top 15 bits * the bottom 16 bits are the absolute position and the top 15 bits
* make up the value index if we are enuerating values. * make up the value index if we are enuerating values.
*/ */
static const __off32_t REG_ENUM_VALUES_MASK = 0x8000000; static const _off_t REG_ENUM_VALUES_MASK = 0x8000000;
static const __off32_t REG_POSITION_MASK = 0xffff; static const _off_t REG_POSITION_MASK = 0xffff;
/* List of root keys in /proc/registry. /* List of root keys in /proc/registry.
* Possibly we should filter out those not relevant to the flavour of Windows * Possibly we should filter out those not relevant to the flavour of Windows
@ -351,14 +351,14 @@ out:
return res; return res;
} }
__off64_t _off64_t
fhandler_registry::telldir (DIR * dir) fhandler_registry::telldir (DIR * dir)
{ {
return dir->__d_position & REG_POSITION_MASK; return dir->__d_position & REG_POSITION_MASK;
} }
void void
fhandler_registry::seekdir (DIR * dir, __off64_t loc) fhandler_registry::seekdir (DIR * dir, _off64_t loc)
{ {
/* Unfortunately cannot simply set __d_position due to transition from sub-keys to /* Unfortunately cannot simply set __d_position due to transition from sub-keys to
* values. * values.

View File

@ -161,8 +161,8 @@ fhandler_dev_tape::fstat (struct __stat64 *buf, path_conv *pc)
return ret; return ret;
} }
__off64_t _off64_t
fhandler_dev_tape::lseek (__off64_t offset, int whence) fhandler_dev_tape::lseek (_off64_t offset, int whence)
{ {
struct mtop op; struct mtop op;
struct mtpos pos; struct mtpos pos;

View File

@ -356,8 +356,8 @@ fhandler_termios::fixup_after_fork (HANDLE parent)
fork_fixup (parent, get_output_handle (), "output_handle"); fork_fixup (parent, get_output_handle (), "output_handle");
} }
__off64_t _off64_t
fhandler_termios::lseek (__off64_t, int) fhandler_termios::lseek (_off64_t, int)
{ {
set_errno (ESPIPE); set_errno (ESPIPE);
return -1; return -1;

View File

@ -93,13 +93,13 @@ fhandler_virtual::opendir (path_conv& pc)
return res; return res;
} }
__off64_t fhandler_virtual::telldir (DIR * dir) _off64_t fhandler_virtual::telldir (DIR * dir)
{ {
return dir->__d_position; return dir->__d_position;
} }
void void
fhandler_virtual::seekdir (DIR * dir, __off64_t loc) fhandler_virtual::seekdir (DIR * dir, _off64_t loc)
{ {
dir->__d_position = loc; dir->__d_position = loc;
return; return;
@ -118,15 +118,15 @@ fhandler_virtual::closedir (DIR * dir)
return 0; return 0;
} }
__off64_t _off64_t
fhandler_virtual::lseek (__off64_t offset, int whence) fhandler_virtual::lseek (_off64_t offset, int whence)
{ {
/* /*
* On Linux, when you lseek within a /proc file, * On Linux, when you lseek within a /proc file,
* the contents of the file are updated. * the contents of the file are updated.
*/ */
if (!fill_filebuf ()) if (!fill_filebuf ())
return (__off64_t) -1; return (_off64_t) -1;
switch (whence) switch (whence)
{ {
case SEEK_SET: case SEEK_SET:
@ -140,7 +140,7 @@ fhandler_virtual::lseek (__off64_t offset, int whence)
break; break;
default: default:
set_errno (EINVAL); set_errno (EINVAL);
return (__off64_t) -1; return (_off64_t) -1;
} }
return position; return position;
} }

View File

@ -42,8 +42,8 @@ fhandler_dev_zero::read (void *ptr, size_t& len)
return; return;
} }
__off64_t _off64_t
fhandler_dev_zero::lseek (__off64_t, int) fhandler_dev_zero::lseek (_off64_t, int)
{ {
return 0; return 0;
} }

View File

@ -26,7 +26,7 @@ struct __stat32
__uid16_t st_uid; __uid16_t st_uid;
__gid16_t st_gid; __gid16_t st_gid;
__dev16_t st_rdev; __dev16_t st_rdev;
__off32_t st_size; _off_t st_size;
timestruc_t st_atim; timestruc_t st_atim;
timestruc_t st_mtim; timestruc_t st_mtim;
timestruc_t st_ctim; timestruc_t st_ctim;
@ -44,7 +44,7 @@ struct __stat64
__uid32_t st_uid; __uid32_t st_uid;
__gid32_t st_gid; __gid32_t st_gid;
__dev32_t st_rdev; __dev32_t st_rdev;
__off64_t st_size; _off64_t st_size;
timestruc_t st_atim; timestruc_t st_atim;
timestruc_t st_mtim; timestruc_t st_mtim;
timestruc_t st_ctim; timestruc_t st_ctim;

View File

@ -31,12 +31,10 @@ typedef struct timespec timestruc_t;
#ifndef __off_t_defined #ifndef __off_t_defined
#define __off_t_defined #define __off_t_defined
typedef long __off32_t;
typedef long long __off64_t;
#ifdef __CYGWIN_USE_BIG_TYPES__ #ifdef __CYGWIN_USE_BIG_TYPES__
typedef __off64_t off_t; typedef _off64_t off_t;
#else #else
typedef __off32_t off_t; typedef _off_t off_t;
#endif #endif
#endif /*__off_t_defined*/ #endif /*__off_t_defined*/

View File

@ -45,13 +45,13 @@ class mmap_record
HANDLE mapping_handle_; HANDLE mapping_handle_;
int devtype_; int devtype_;
DWORD access_mode_; DWORD access_mode_;
__off64_t offset_; _off64_t offset_;
DWORD size_to_map_; DWORD size_to_map_;
caddr_t base_address_; caddr_t base_address_;
DWORD *map_map_; DWORD *map_map_;
public: public:
mmap_record (int fd, HANDLE h, DWORD ac, __off64_t o, DWORD s, caddr_t b) : mmap_record (int fd, HANDLE h, DWORD ac, _off64_t o, DWORD s, caddr_t b) :
fdesc_ (fd), fdesc_ (fd),
mapping_handle_ (h), mapping_handle_ (h),
devtype_ (0), devtype_ (0),
@ -76,11 +76,11 @@ class mmap_record
DWORD get_size () const { return size_to_map_; } DWORD get_size () const { return size_to_map_; }
caddr_t get_address () const { return base_address_; } caddr_t get_address () const { return base_address_; }
DWORD *get_map () const { return map_map_; } DWORD *get_map () const { return map_map_; }
void alloc_map (__off64_t off, DWORD len); void alloc_map (_off64_t off, DWORD len);
void free_map () { if (map_map_) free (map_map_); } void free_map () { if (map_map_) free (map_map_); }
DWORD find_empty (DWORD pages); DWORD find_empty (DWORD pages);
__off64_t map_map (__off64_t off, DWORD len); _off64_t map_map (_off64_t off, DWORD len);
BOOL unmap_map (caddr_t addr, DWORD len); BOOL unmap_map (caddr_t addr, DWORD len);
void fixup_map (void); void fixup_map (void);
int access (caddr_t address); int access (caddr_t address);
@ -111,7 +111,7 @@ mmap_record::find_empty (DWORD pages)
} }
void void
mmap_record::alloc_map (__off64_t off, DWORD len) mmap_record::alloc_map (_off64_t off, DWORD len)
{ {
/* Allocate one bit per page */ /* Allocate one bit per page */
map_map_ = (DWORD *) calloc (MAPSIZE (PAGE_CNT (size_to_map_)), map_map_ = (DWORD *) calloc (MAPSIZE (PAGE_CNT (size_to_map_)),
@ -138,8 +138,8 @@ mmap_record::alloc_map (__off64_t off, DWORD len)
} }
} }
__off64_t _off64_t
mmap_record::map_map (__off64_t off, DWORD len) mmap_record::map_map (_off64_t off, DWORD len)
{ {
/* Used ONLY if this mapping matches into the chunk of another already /* Used ONLY if this mapping matches into the chunk of another already
performed mapping in a special case of MAP_ANON|MAP_PRIVATE. performed mapping in a special case of MAP_ANON|MAP_PRIVATE.
@ -169,7 +169,7 @@ mmap_record::map_map (__off64_t off, DWORD len)
len * getpagesize (), prot, &old_prot)) len * getpagesize (), prot, &old_prot))
{ {
__seterrno (); __seterrno ();
return (__off64_t)-1; return (_off64_t)-1;
} }
while (len-- > 0) while (len-- > 0)
@ -267,10 +267,10 @@ public:
DWORD hash; DWORD hash;
list (); list ();
~list (); ~list ();
mmap_record *add_record (mmap_record r, __off64_t off, DWORD len); mmap_record *add_record (mmap_record r, _off64_t off, DWORD len);
void erase (int i); void erase (int i);
void erase (); void erase ();
mmap_record *match (__off64_t off, DWORD len); mmap_record *match (_off64_t off, DWORD len);
long match (caddr_t addr, DWORD len, long start); long match (caddr_t addr, DWORD len, long start);
}; };
@ -288,7 +288,7 @@ list::~list ()
} }
mmap_record * mmap_record *
list::add_record (mmap_record r, __off64_t off, DWORD len) list::add_record (mmap_record r, _off64_t off, DWORD len)
{ {
if (nrecs == maxrecs) if (nrecs == maxrecs)
{ {
@ -302,7 +302,7 @@ list::add_record (mmap_record r, __off64_t off, DWORD len)
/* Used in mmap() */ /* Used in mmap() */
mmap_record * mmap_record *
list::match (__off64_t off, DWORD len) list::match (_off64_t off, DWORD len)
{ {
if (fd == -1 && !off) if (fd == -1 && !off)
{ {
@ -324,7 +324,7 @@ list::match (__off64_t off, DWORD len)
/* Used in munmap() */ /* Used in munmap() */
long long
list::match (caddr_t addr, DWORD len, __off32_t start) list::match (caddr_t addr, DWORD len, _off_t start)
{ {
for (int i = start + 1; i < nrecs; ++i) for (int i = start + 1; i < nrecs; ++i)
if (addr >= recs[i].get_address () if (addr >= recs[i].get_address ()
@ -422,7 +422,7 @@ map::erase (int i)
static map *mmapped_areas; static map *mmapped_areas;
extern "C" caddr_t extern "C" caddr_t
mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off) mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, _off64_t off)
{ {
syscall_printf ("addr %x, len %d, prot %x, flags %x, fd %d, off %D", syscall_printf ("addr %x, len %d, prot %x, flags %x, fd %d, off %D",
addr, len, prot, flags, fd, off); addr, len, prot, flags, fd, off);
@ -466,7 +466,7 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off)
fd = -1; fd = -1;
/* Map always in multipliers of `granularity'-sized chunks. */ /* Map always in multipliers of `granularity'-sized chunks. */
__off64_t gran_off = off & ~(granularity - 1); _off64_t gran_off = off & ~(granularity - 1);
DWORD gran_len = howmany (off + len, granularity) * granularity - gran_off; DWORD gran_len = howmany (off + len, granularity) * granularity - gran_off;
fhandler_base *fh; fhandler_base *fh;
@ -488,7 +488,7 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off)
{ {
DWORD high; DWORD high;
DWORD low = GetFileSize (fh->get_handle (), &high); DWORD low = GetFileSize (fh->get_handle (), &high);
__off64_t fsiz = ((__off64_t)high << 32) + low; _off64_t fsiz = ((_off64_t)high << 32) + low;
fsiz -= gran_off; fsiz -= gran_off;
if (gran_len > fsiz) if (gran_len > fsiz)
gran_len = fsiz; gran_len = fsiz;
@ -513,7 +513,7 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off)
mmap_record *rec; mmap_record *rec;
if ((rec = map_list->match (off, len)) != NULL) if ((rec = map_list->match (off, len)) != NULL)
{ {
if ((off = rec->map_map (off, len)) == (__off64_t)-1) if ((off = rec->map_map (off, len)) == (_off64_t)-1)
{ {
syscall_printf ("-1 = mmap()"); syscall_printf ("-1 = mmap()");
ReleaseResourceLock (LOCK_MMAP_LIST, READ_LOCK|WRITE_LOCK, "mmap"); ReleaseResourceLock (LOCK_MMAP_LIST, READ_LOCK|WRITE_LOCK, "mmap");
@ -583,9 +583,9 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off)
} }
extern "C" caddr_t extern "C" caddr_t
mmap (caddr_t addr, size_t len, int prot, int flags, int fd, __off32_t off) mmap (caddr_t addr, size_t len, int prot, int flags, int fd, _off_t off)
{ {
return mmap64 (addr, len, prot, flags, fd, (__off64_t)off); return mmap64 (addr, len, prot, flags, fd, (_off64_t)off);
} }
/* munmap () removes an mmapped area. It insists that base area /* munmap () removes an mmapped area. It insists that base area
@ -733,7 +733,7 @@ invalid_address_range:
*/ */
HANDLE HANDLE
fhandler_base::mmap (caddr_t *addr, size_t len, DWORD access, fhandler_base::mmap (caddr_t *addr, size_t len, DWORD access,
int flags, __off64_t off) int flags, _off64_t off)
{ {
set_errno (ENODEV); set_errno (ENODEV);
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;
@ -764,7 +764,7 @@ fhandler_base::fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset,
/* Implementation for disk files. */ /* Implementation for disk files. */
HANDLE HANDLE
fhandler_disk_file::mmap (caddr_t *addr, size_t len, DWORD access, fhandler_disk_file::mmap (caddr_t *addr, size_t len, DWORD access,
int flags, __off64_t off) int flags, _off64_t off)
{ {
DWORD protect; DWORD protect;

View File

@ -33,8 +33,8 @@ fhandler_pipe::fhandler_pipe (DWORD devtype)
{ {
} }
__off64_t _off64_t
fhandler_pipe::lseek (__off64_t offset, int whence) fhandler_pipe::lseek (_off64_t offset, int whence)
{ {
debug_printf ("(%d, %d)", offset, whence); debug_printf ("(%d, %d)", offset, whence);
set_errno (ESPIPE); set_errno (ESPIPE);

View File

@ -533,10 +533,10 @@ extern "C" int _open (const char *, int flags, ...)
extern "C" int _open64 (const char *, int flags, ...) extern "C" int _open64 (const char *, int flags, ...)
__attribute__ ((alias ("open"))); __attribute__ ((alias ("open")));
extern "C" __off64_t extern "C" _off64_t
lseek64 (int fd, __off64_t pos, int dir) lseek64 (int fd, _off64_t pos, int dir)
{ {
__off64_t res; _off64_t res;
sigframe thisframe (mainthread); sigframe thisframe (mainthread);
if (dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END) if (dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END)
@ -557,16 +557,16 @@ lseek64 (int fd, __off64_t pos, int dir)
return res; return res;
} }
extern "C" int _lseek64 (int fd, __off64_t pos, int dir) extern "C" int _lseek64 (int fd, _off64_t pos, int dir)
__attribute__ ((alias ("lseek64"))); __attribute__ ((alias ("lseek64")));
extern "C" __off32_t extern "C" _off_t
lseek (int fd, __off32_t pos, int dir) lseek (int fd, _off_t pos, int dir)
{ {
return lseek64 (fd, (__off64_t) pos, dir); return lseek64 (fd, (_off64_t) pos, dir);
} }
extern "C" __off32_t _lseek (int, __off32_t, int) extern "C" _off_t _lseek (int, _off_t, int)
__attribute__ ((alias ("lseek"))); __attribute__ ((alias ("lseek")));
extern "C" int extern "C" int
@ -1030,7 +1030,7 @@ fstat64 (int fd, struct __stat64 *buf)
return res; return res;
} }
extern "C" int _fstat64 (int fd, __off64_t pos, int dir) extern "C" int _fstat64 (int fd, _off64_t pos, int dir)
__attribute__ ((alias ("fstat64"))); __attribute__ ((alias ("fstat64")));
extern "C" int extern "C" int
@ -1043,7 +1043,7 @@ fstat (int fd, struct __stat32 *buf)
return ret; return ret;
} }
extern "C" int _fstat (int fd, __off64_t pos, int dir) extern "C" int _fstat (int fd, _off64_t pos, int dir)
__attribute__ ((alias ("fstat"))); __attribute__ ((alias ("fstat")));
/* fsync: P96 6.6.1.1 */ /* fsync: P96 6.6.1.1 */
@ -1130,7 +1130,7 @@ stat_worker (const char *name, struct __stat64 *buf, int nofollow,
return res; return res;
} }
extern "C" int _stat (int fd, __off64_t pos, int dir) extern "C" int _stat (int fd, _off64_t pos, int dir)
__attribute__ ((alias ("stat"))); __attribute__ ((alias ("stat")));
extern "C" int extern "C" int
@ -1736,7 +1736,7 @@ setmode (int fd, int mode)
} }
extern "C" int extern "C" int
ftruncate64 (int fd, __off64_t length) ftruncate64 (int fd, _off64_t length)
{ {
sigframe thisframe (mainthread); sigframe thisframe (mainthread);
int res = -1; int res = -1;
@ -1753,7 +1753,7 @@ ftruncate64 (int fd, __off64_t length)
if (cfd->get_handle ()) if (cfd->get_handle ())
{ {
/* remember curr file pointer location */ /* remember curr file pointer location */
__off64_t prev_loc = cfd->lseek (0, SEEK_CUR); _off64_t prev_loc = cfd->lseek (0, SEEK_CUR);
cfd->lseek (length, SEEK_SET); cfd->lseek (length, SEEK_SET);
if (!SetEndOfFile (h)) if (!SetEndOfFile (h))
@ -1773,14 +1773,14 @@ ftruncate64 (int fd, __off64_t length)
/* ftruncate: P96 5.6.7.1 */ /* ftruncate: P96 5.6.7.1 */
extern "C" int extern "C" int
ftruncate (int fd, __off32_t length) ftruncate (int fd, _off_t length)
{ {
return ftruncate64 (fd, (__off64_t)length); return ftruncate64 (fd, (_off64_t)length);
} }
/* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */ /* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */
extern "C" int extern "C" int
truncate64 (const char *pathname, __off64_t length) truncate64 (const char *pathname, _off64_t length)
{ {
sigframe thisframe (mainthread); sigframe thisframe (mainthread);
int fd; int fd;
@ -1802,9 +1802,9 @@ truncate64 (const char *pathname, __off64_t length)
/* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */ /* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */
extern "C" int extern "C" int
truncate (const char *pathname, __off32_t length) truncate (const char *pathname, _off_t length)
{ {
return truncate64 (pathname, (__off64_t)length); return truncate64 (pathname, (_off64_t)length);
} }
extern "C" long extern "C" long

View File

@ -162,7 +162,7 @@ void uinfo_init (void);
#define ILLEGAL_UID ((__uid32_t)-1) #define ILLEGAL_UID ((__uid32_t)-1)
#define ILLEGAL_GID16 ((__gid16_t)-1) #define ILLEGAL_GID16 ((__gid16_t)-1)
#define ILLEGAL_GID ((__gid32_t)-1) #define ILLEGAL_GID ((__gid32_t)-1)
#define ILLEGAL_SEEK ((__off64_t)-1) #define ILLEGAL_SEEK ((_off64_t)-1)
#define uid16touid32(u16) ((u16)==ILLEGAL_UID16?ILLEGAL_UID:(__uid32_t)(u16)) #define uid16touid32(u16) ((u16)==ILLEGAL_UID16?ILLEGAL_UID:(__uid32_t)(u16))
#define gid16togid32(g16) ((g16)==ILLEGAL_GID16?ILLEGAL_GID:(__gid32_t)(g16)) #define gid16togid32(g16) ((g16)==ILLEGAL_GID16?ILLEGAL_GID:(__gid32_t)(g16))