* cygwin.din (fstat64): New symbol.

(ftruncate64): Ditto.
	(lseek64): Ditto.
	(lstat64): Ditto.
	(mmap64): Ditto.
	(seekdir64): Ditto.
	(stat64): Ditto.
	(telldir64): Ditto.
	(truncate64): Ditto.
	* dir.cc (telldir64): New function.
	(telldir): Call telldir64().
	(seekdir64): New function.
	(seekdir): Call seekdir64().
	* fhandler.h: Redefine all methods using __off32_t to use __off64_t.
	* fhandler.cc: Use __off64_t and struct __stat64 throughout.
	* fhandler_clipboard.cc: Ditto.
	* fhandler_disk_file.cc: Ditto.
	* fhandler_dsp.cc: Ditto.
	* fhandler_floppy.cc: Ditto.
	* fhandler_mem.cc: Ditto.
	* fhandler_random.cc: Ditto.
	* fhandler_socket.cc: Ditto.
	* fhandler_tape.cc: Ditto.
	* fhandler_zero.cc: Ditto.
	* pipe.cc: Ditto.
	* glob.c: Ditto, call lstat64 and stat64 in Cygwin.
	* mmap.cc: Use __off64_t throughout.
	(mmap64): New function.
	* sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64.
	* syscalls.cc (lseek64): New function.
	(stat64_to_stat32): Ditto.
	(fstat64): Ditto.
	(stat64): Ditto.
	(lstat64): Ditto.
	(ftruncate64): Ditto.
	(truncate64): Ditto.
	(_fstat): Call fstat64.
	(_stat): Call stat64.
	(cygwin_lstat): Rename to avoid declaration problem.  Call lstat64.
	(stat_worker): Use struct __stat64.
	(access): Ditto.
	(ftruncate): Call ftruncate64.
	(truncate): Call truncate64.
	* wincap.cc: Set flag has_64bit_file_access appropriately.
	* wincap.h: Add flag has_64bit_file_access.
	* winsup.h (ILLEGAL_SEEK): Define as __off64_t.
	(stat_dev): Declare using struct __stat64.
	(stat_worker): Ditto.
	* include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin.
	(struct __stat64): Ditto.
	(struct stat): Revert definition with explicitly sized datatypes.
	Eliminate sized field names.
	* include/cygwin/types.h (blksize_t): New type.
	(__blkcnt32_t): Ditto.
	(__blkcnt64_t): Ditto.
	(blkcnt_t): Ditto.
This commit is contained in:
Corinna Vinschen
2002-02-25 17:47:51 +00:00
parent 5a909729b1
commit acb5617538
24 changed files with 433 additions and 238 deletions

View File

@ -282,19 +282,19 @@ class fhandler_base
virtual int open (path_conv * real_path, int flags, mode_t mode = 0);
virtual int close ();
virtual int __stdcall fstat (struct stat *buf, path_conv *) __attribute__ ((regparm (3)));
virtual int __stdcall fstat (struct __stat64 *buf, path_conv *) __attribute__ ((regparm (3)));
virtual int ioctl (unsigned int cmd, void *);
virtual int fcntl (int cmd, void *);
virtual char const * ttyname () { return get_name(); }
virtual int __stdcall read (void *ptr, size_t len) __attribute__ ((regparm (3)));
virtual int write (const void *ptr, size_t len);
virtual __off32_t lseek (__off32_t offset, int whence);
virtual __off64_t lseek (__off64_t offset, int whence);
virtual int lock (int, struct flock *);
virtual void dump ();
virtual int dup (fhandler_base *child);
virtual HANDLE mmap (caddr_t *addr, size_t len, DWORD access,
int flags, __off32_t off);
int flags, __off64_t off);
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 BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset,
@ -347,8 +347,8 @@ class fhandler_base
virtual void set_eof () {}
virtual DIR *opendir (path_conv& pc);
virtual dirent *readdir (DIR *);
virtual __off32_t telldir (DIR *);
virtual void seekdir (DIR *, __off32_t);
virtual __off64_t telldir (DIR *);
virtual void seekdir (DIR *, __off64_t);
virtual void rewinddir (DIR *);
virtual int closedir (DIR *);
};
@ -382,7 +382,7 @@ class fhandler_socket: public fhandler_base
int ioctl (unsigned int cmd, void *);
int fcntl (int cmd, void *);
__off32_t lseek (__off32_t, int) { return 0; }
__off64_t lseek (__off64_t, int) { return 0; }
int close ();
void hclose (HANDLE) {close ();}
int dup (fhandler_base *child);
@ -405,7 +405,7 @@ class fhandler_socket: public fhandler_base
int check_peer_secret_event (struct sockaddr_in *peer, int *secret = NULL);
void signal_secret_event ();
void close_secret_event ();
int __stdcall fstat (struct stat *buf, path_conv *) __attribute__ ((regparm (3)));
int __stdcall fstat (struct __stat64 *buf, path_conv *) __attribute__ ((regparm (3)));
};
class fhandler_pipe: public fhandler_base
@ -417,7 +417,7 @@ class fhandler_pipe: public fhandler_base
unsigned id;
public:
fhandler_pipe (DWORD devtype);
__off32_t lseek (__off32_t offset, int whence);
__off64_t lseek (__off64_t offset, int whence);
select_record *select_read (select_record *s);
select_record *select_write (select_record *s);
select_record *select_except (select_record *s);
@ -489,7 +489,7 @@ class fhandler_dev_floppy: public fhandler_dev_raw
virtual int open (path_conv *, int flags, mode_t mode = 0);
virtual int close (void);
virtual __off32_t lseek (__off32_t offset, int whence);
virtual __off64_t lseek (__off64_t offset, int whence);
virtual int ioctl (unsigned int cmd, void *buf);
};
@ -512,9 +512,9 @@ class fhandler_dev_tape: public fhandler_dev_raw
int open (path_conv *, int flags, mode_t mode = 0);
int close (void);
__off32_t lseek (__off32_t offset, int whence);
__off64_t lseek (__off64_t offset, int whence);
int __stdcall fstat (struct stat *buf, path_conv *) __attribute__ ((regparm (3)));
int __stdcall fstat (struct __stat64 *buf, path_conv *) __attribute__ ((regparm (3)));
int dup (fhandler_base *child);
@ -545,18 +545,18 @@ class fhandler_disk_file: public fhandler_base
int close ();
int lock (int, struct flock *);
BOOL is_device () { return FALSE; }
int __stdcall fstat (struct stat *buf, path_conv *pc) __attribute__ ((regparm (3)));
int __stdcall fstat_helper (struct stat *buf) __attribute__ ((regparm (2)));
int __stdcall fstat (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3)));
int __stdcall fstat_helper (struct __stat64 *buf) __attribute__ ((regparm (2)));
HANDLE mmap (caddr_t *addr, size_t len, DWORD access, int flags, __off32_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 msync (HANDLE h, caddr_t addr, size_t len, int flags);
BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset,
DWORD size, void *address);
DIR *opendir (path_conv& pc);
struct dirent *readdir (DIR *);
__off32_t telldir (DIR *);
void seekdir (DIR *, __off32_t);
__off64_t telldir (DIR *);
void seekdir (DIR *, __off64_t);
void rewinddir (DIR *);
int closedir (DIR *);
};
@ -572,11 +572,11 @@ class fhandler_cygdrive: public fhandler_disk_file
fhandler_cygdrive (int unit);
DIR *opendir (path_conv& pc);
struct dirent *readdir (DIR *);
__off32_t telldir (DIR *);
void seekdir (DIR *, __off32_t);
__off64_t telldir (DIR *);
void seekdir (DIR *, __off64_t);
void rewinddir (DIR *);
int closedir (DIR *);
int __stdcall fstat (struct stat *buf, path_conv *pc) __attribute__ ((regparm (3)));
int __stdcall fstat (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3)));
};
class fhandler_serial: public fhandler_base
@ -606,7 +606,7 @@ class fhandler_serial: public fhandler_base
int tcflow (int);
int tcsetattr (int a, const struct termios *t);
int tcgetattr (struct termios *t);
__off32_t lseek (__off32_t, int) { return 0; }
__off64_t lseek (__off64_t, int) { return 0; }
int tcflush (int);
void dump ();
int is_tty () { return 1; }
@ -837,7 +837,7 @@ class fhandler_tty_slave: public fhandler_tty_common
int tcflush (int);
int ioctl (unsigned int cmd, void *);
__off32_t lseek (__off32_t, int) { return 0; }
__off64_t lseek (__off64_t, int) { return 0; }
select_record *select_read (select_record *s);
int ready_for_read (int fd, DWORD howlong);
};
@ -864,7 +864,7 @@ class fhandler_pty_master: public fhandler_tty_common
int tcflush (int);
int ioctl (unsigned int cmd, void *);
__off32_t lseek (__off32_t, int) { return 0; }
__off64_t lseek (__off64_t, int) { return 0; }
char *ptsname ();
void set_close_on_exec (int val);
@ -903,7 +903,7 @@ class fhandler_dev_zero: public fhandler_base
int open (path_conv *, int flags, mode_t mode = 0);
int write (const void *ptr, size_t len);
int __stdcall read (void *ptr, size_t len) __attribute__ ((regparm (3)));
__off32_t lseek (__off32_t offset, int whence);
__off64_t lseek (__off64_t offset, int whence);
int close (void);
void dump ();
@ -926,7 +926,7 @@ class fhandler_dev_random: public fhandler_base
int open (path_conv *, int flags, mode_t mode = 0);
int write (const void *ptr, size_t len);
int __stdcall read (void *ptr, size_t len) __attribute__ ((regparm (3)));
__off32_t lseek (__off32_t offset, int whence);
__off64_t lseek (__off64_t offset, int whence);
int close (void);
int dup (fhandler_base *child);
@ -938,7 +938,7 @@ class fhandler_dev_mem: public fhandler_base
protected:
int unit;
DWORD mem_size;
DWORD pos;
__off64_t pos;
public:
fhandler_dev_mem (int unit);
@ -947,12 +947,12 @@ class fhandler_dev_mem: public fhandler_base
int open (path_conv *, int flags, mode_t mode = 0);
int write (const void *ptr, size_t ulen);
int __stdcall read (void *ptr, size_t len) __attribute__ ((regparm (3)));
__off32_t lseek (__off32_t offset, int whence);
__off64_t lseek (__off64_t offset, int whence);
int close (void);
int __stdcall fstat (struct stat *buf, path_conv *) __attribute__ ((regparm (3)));
int __stdcall fstat (struct __stat64 *buf, path_conv *) __attribute__ ((regparm (3)));
int dup (fhandler_base *child);
HANDLE mmap (caddr_t *addr, size_t len, DWORD access, int flags, __off32_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 msync (HANDLE h, caddr_t addr, size_t len, int flags);
BOOL fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset,
@ -969,7 +969,7 @@ class fhandler_dev_clipboard: public fhandler_base
int open (path_conv *, int flags, mode_t mode = 0);
int write (const void *ptr, size_t len);
int __stdcall read (void *ptr, size_t len) __attribute__ ((regparm (3)));
__off32_t lseek (__off32_t offset, int whence);
__off64_t lseek (__off64_t offset, int whence);
int close (void);
int dup (fhandler_base *child);
@ -977,7 +977,7 @@ class fhandler_dev_clipboard: public fhandler_base
void dump ();
private:
__off32_t pos;
__off64_t pos;
void *membuffer;
size_t msize;
bool eof;
@ -995,7 +995,7 @@ class fhandler_windows: public fhandler_base
int write (const void *ptr, size_t len);
int __stdcall read (void *ptr, size_t len) __attribute__ ((regparm (3)));
int ioctl (unsigned int cmd, void *);
__off32_t lseek (__off32_t, int) { return 0; }
__off64_t lseek (__off64_t, int) { return 0; }
int close (void) { return 0; }
void set_close_on_exec (int val);
@ -1021,7 +1021,7 @@ class fhandler_dev_dsp : public fhandler_base
int write (const void *ptr, size_t len);
int __stdcall read (void *ptr, size_t len) __attribute__ ((regparm (3)));
int ioctl (unsigned int cmd, void *);
__off32_t lseek (__off32_t, int);
__off64_t lseek (__off64_t, int);
int close (void);
int dup (fhandler_base * child);
void dump (void);