Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3f1ed52d
Commit
3f1ed52d
authored
May 14, 2001
by
Marcus Meissner
Committed by
Alexandre Julliard
May 14, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented 64bit file size handling.
Removed several unneeded sys/stat.h includes.
parent
5920737f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
260 additions
and
83 deletions
+260
-83
configure
configure
+0
-0
configure.in
configure.in
+42
-0
shelllink.c
dlls/shell32/shelllink.c
+0
-1
aspi.c
dlls/winaspi/aspi.c
+0
-1
winaspi16.c
dlls/winaspi/winaspi16.c
+0
-1
winaspi32.c
dlls/winaspi/winaspi32.c
+0
-1
dosvm.c
dlls/winedos/dosvm.c
+0
-1
afm.c
dlls/wineps/afm.c
+0
-1
ftp.c
dlls/wininet/ftp.c
+0
-1
file.c
files/file.c
+17
-19
xfont.c
graphics/x11drv/xfont.c
+0
-2
acconfig.h
include/acconfig.h
+6
-0
config.h.in
include/config.h.in
+21
-0
port.h
include/wine/port.h
+53
-1
loader.c
library/loader.c
+1
-1
port.c
library/port.c
+87
-1
dosmod.c
loader/dos/dosmod.c
+0
-1
resource.c
loader/ne/resource.c
+0
-1
segment.c
loader/ne/segment.c
+0
-1
int13.c
msdos/int13.c
+1
-2
int21.c
msdos/int21.c
+0
-1
console.c
server/console.c
+0
-4
file.c
server/file.c
+29
-29
pipe.c
server/pipe.c
+0
-1
serial.c
server/serial.c
+0
-1
sock.c
server/sock.c
+0
-1
device.c
win32/device.c
+0
-7
file.c
win32/file.c
+3
-2
clipboard.c
windows/clipboard.c
+0
-1
No files found.
configure
View file @
3f1ed52d
This diff is collapsed.
Click to expand it.
configure.in
View file @
3f1ed52d
...
...
@@ -757,6 +757,8 @@ AC_CHECK_FUNCS(\
ecvt \
finite \
fpclass \
fstat64 \
ftruncate64 \
getnetbyaddr \
getnetbyname \
getpagesize \
...
...
@@ -766,7 +768,9 @@ AC_CHECK_FUNCS(\
getservbyport \
getsockopt \
inet_network \
lseek64 \
lstat \
lstat64 \
memmove \
mmap \
rfork \
...
...
@@ -774,6 +778,7 @@ AC_CHECK_FUNCS(\
sendmsg \
settimeofday \
sigaltstack \
stat64 \
statfs \
strcasecmp \
strerror \
...
...
@@ -850,6 +855,43 @@ AC_C_INLINE()
AC_TYPE_SIZE_T()
AC_CHECK_SIZEOF(long long,0)
AC_CACHE_CHECK("for off64_t",
wine_cv_off64_t,
AC_TRY_COMPILE([
#define _LARGEFILE64_SOURCE
#include <sys/types.h>
],[
off64_t testoffset;
],
wine_cv_off64_t="yes",
wine_cv_off64_t="no",
wine_cv_off64_t="yes"
)
)
if test "$wine_cv_off64_t" = "yes"
then
AC_DEFINE(HAVE_OFF64_T)
fi
AC_CACHE_CHECK("for struct stat64",
wine_cv_struct_stat64,
AC_TRY_COMPILE([
#define _LARGEFILE64_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
],[
struct stat64 tst64;
],
wine_cv_struct_stat64="yes",
wine_cv_struct_stat64="no",
wine_cv_struct_stat64="yes"
)
)
if test "$wine_cv_struct_stat64" = "yes"
then
AC_DEFINE(HAVE_STRUCT_STAT64)
fi
AC_CACHE_CHECK("whether linux/input.h is for real",
wine_cv_linux_input_h,
AC_TRY_COMPILE([
...
...
dlls/shell32/shelllink.c
View file @
3f1ed52d
...
...
@@ -8,7 +8,6 @@
#include "config.h"
#include <string.h>
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
...
...
dlls/winaspi/aspi.c
View file @
3f1ed52d
...
...
@@ -25,7 +25,6 @@ HKEY_DYN_DATA
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <dirent.h>
...
...
dlls/winaspi/winaspi16.c
View file @
3f1ed52d
...
...
@@ -2,7 +2,6 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <memory.h>
...
...
dlls/winaspi/winaspi32.c
View file @
3f1ed52d
...
...
@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <memory.h>
...
...
dlls/winedos/dosvm.c
View file @
3f1ed52d
...
...
@@ -17,7 +17,6 @@
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "wine/winbase16.h"
#include "wine/exception.h"
...
...
dlls/wineps/afm.c
View file @
3f1ed52d
...
...
@@ -9,7 +9,6 @@
#include <string.h>
#include <stdlib.h>
/* qsort() & bsearch() */
#include <stdio.h>
#include <sys/stat.h>
#include <dirent.h>
#include <limits.h>
/* INT_MIN */
#include <float.h>
/* FLT_MAX */
...
...
dlls/wininet/ftp.c
View file @
3f1ed52d
...
...
@@ -22,7 +22,6 @@
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#ifdef HAVE_NETINET_IN_SYSTM_H
...
...
files/file.c
View file @
3f1ed52d
...
...
@@ -10,6 +10,7 @@
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
...
...
@@ -36,7 +37,6 @@
#include "windef.h"
#include "winbase.h"
#include "wine/winbase16.h"
#include "wine/port.h"
#include "drive.h"
#include "file.h"
#include "heap.h"
...
...
@@ -491,7 +491,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
*
* Fill a file information from a struct stat.
*/
static
void
FILE_FillInfo
(
struct
stat
*
st
,
BY_HANDLE_FILE_INFORMATION
*
info
)
static
void
FILE_FillInfo
(
struct
stat
64
*
st
,
BY_HANDLE_FILE_INFORMATION
*
info
)
{
if
(
S_ISDIR
(
st
->
st_mode
))
info
->
dwFileAttributes
=
FILE_ATTRIBUTE_DIRECTORY
;
...
...
@@ -506,7 +506,11 @@ static void FILE_FillInfo( struct stat *st, BY_HANDLE_FILE_INFORMATION *info )
info
->
dwVolumeSerialNumber
=
0
;
/* FIXME */
info
->
nFileSizeHigh
=
0
;
info
->
nFileSizeLow
=
S_ISDIR
(
st
->
st_mode
)
?
0
:
st
->
st_size
;
info
->
nFileSizeLow
=
0
;
if
(
!
S_ISDIR
(
st
->
st_mode
))
{
info
->
nFileSizeHigh
=
st
->
st_size
>>
32
;
info
->
nFileSizeLow
=
st
->
st_size
&
0xffffffff
;
}
info
->
nNumberOfLinks
=
st
->
st_nlink
;
info
->
nFileIndexHigh
=
0
;
info
->
nFileIndexLow
=
st
->
st_ino
;
...
...
@@ -520,9 +524,9 @@ static void FILE_FillInfo( struct stat *st, BY_HANDLE_FILE_INFORMATION *info )
*/
BOOL
FILE_Stat
(
LPCSTR
unixName
,
BY_HANDLE_FILE_INFORMATION
*
info
)
{
struct
stat
st
;
struct
stat
64
st
;
if
(
lstat
(
unixName
,
&
st
)
==
-
1
)
if
(
lstat
64
(
unixName
,
&
st
)
==
-
1
)
{
FILE_SetDosError
();
return
FALSE
;
...
...
@@ -532,7 +536,7 @@ BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info )
{
/* do a "real" stat to find out
about the type of the symlink destination */
if
(
stat
(
unixName
,
&
st
)
==
-
1
)
if
(
stat
64
(
unixName
,
&
st
)
==
-
1
)
{
FILE_SetDosError
();
return
FALSE
;
...
...
@@ -1644,17 +1648,8 @@ DWORD WINAPI SetFilePointer( HANDLE hFile, LONG distance, LONG *highword,
{
DWORD
ret
=
0xffffffff
;
if
(
highword
&&
((
distance
>=
0
&&
*
highword
!=
0
)
||
(
distance
<
0
&&
*
highword
!=
-
1
)))
{
FIXME
(
"64-bit offsets not supported yet
\n
"
"SetFilePointer(%08x,%08lx,%08lx,%08lx)
\n
"
,
hFile
,
distance
,
*
highword
,
method
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
ret
;
}
TRACE
(
"handle %d offset %ld origin %ld
\n
"
,
hFile
,
distance
,
method
);
TRACE
(
"handle %d offset %ld high %ld origin %ld
\n
"
,
hFile
,
distance
,
highword
?*
highword
:
0
,
method
);
SERVER_START_REQ
(
set_file_pointer
)
{
...
...
@@ -2015,7 +2010,10 @@ BOOL WINAPI MoveFileExW( LPCWSTR fn1, LPCWSTR fn2, DWORD flag )
BOOL
WINAPI
MoveFileA
(
LPCSTR
fn1
,
LPCSTR
fn2
)
{
DOS_FULL_NAME
full_name1
,
full_name2
;
struct
stat
fstat
;
/* Even though we do not need the size, stat will fail for large files,
* so we need to use stat64 here. */
struct
stat64
fstat
;
TRACE
(
"(%s,%s)
\n
"
,
fn1
,
fn2
);
...
...
@@ -2035,7 +2033,7 @@ BOOL WINAPI MoveFileA( LPCSTR fn1, LPCSTR fn2 )
}
else
return
TRUE
;
else
/*copy */
{
if
(
stat
(
full_name1
.
long_name
,
&
fstat
))
if
(
stat
64
(
full_name1
.
long_name
,
&
fstat
))
{
WARN
(
"Invalid source file %s
\n
"
,
full_name1
.
long_name
);
...
...
graphics/x11drv/xfont.c
View file @
3f1ed52d
...
...
@@ -19,10 +19,8 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <math.h>
#include <assert.h>
#include "windef.h"
#include "wingdi.h"
...
...
include/acconfig.h
View file @
3f1ed52d
...
...
@@ -122,3 +122,9 @@
/* Define if we have CUPS */
#undef HAVE_CUPS
/* Define if we have 64 bit file offsets */
#undef HAVE_OFF64_T
/* Define if we have struct stat64 */
#undef HAVE_STRUCT_STAT64
include/config.h.in
View file @
3f1ed52d
...
...
@@ -154,6 +154,12 @@
/* Define if we have CUPS */
#undef HAVE_CUPS
/* Define if we have 64 bit file offsets */
#undef HAVE_OFF64_T
/* Define if we have struct stat64 */
#undef HAVE_STRUCT_STAT64
/* The number of bytes in a long long. */
#undef SIZEOF_LONG_LONG
...
...
@@ -181,6 +187,12 @@
/* Define if you have the fpclass function. */
#undef HAVE_FPCLASS
/* Define if you have the fstat64 function. */
#undef HAVE_FSTAT64
/* Define if you have the ftruncate64 function. */
#undef HAVE_FTRUNCATE64
/* Define if you have the gethostbyname function. */
#undef HAVE_GETHOSTBYNAME
...
...
@@ -214,9 +226,15 @@
/* Define if you have the iswalnum function. */
#undef HAVE_ISWALNUM
/* Define if you have the lseek64 function. */
#undef HAVE_LSEEK64
/* Define if you have the lstat function. */
#undef HAVE_LSTAT
/* Define if you have the lstat64 function. */
#undef HAVE_LSTAT64
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
...
...
@@ -241,6 +259,9 @@
/* Define if you have the sigaltstack function. */
#undef HAVE_SIGALTSTACK
/* Define if you have the stat64 function. */
#undef HAVE_STAT64
/* Define if you have the statfs function. */
#undef HAVE_STATFS
...
...
include/wine/port.h
View file @
3f1ed52d
...
...
@@ -6,9 +6,10 @@
#ifndef __WINE_WINE_PORT_H
#define __WINE_WINE_PORT_H
#define _LARGEFILE64_SOURCE
/* for glibc 64 bit file functions */
#include "config.h"
#include "winnt.h"
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
...
...
@@ -131,6 +132,57 @@ int lstat(const char *file_name, struct stat *buf);
#define S_ISLNK(mod) (0)
#endif
/* S_ISLNK */
#ifndef HAVE_OFF64_T
# if SIZEOF_LONG_LONG > 0
typedef
long
long
off64_t
;
# else
typedef
long
off64_t
;
# endif
#endif
#ifndef HAVE_STRUCT_STAT64
/* This does not convert all struct members to 64bit, only size. */
struct
stat64
{
dev_t
st_dev
;
/* device */
ino_t
st_ino
;
/* inode */
mode_t
st_mode
;
/* protection */
nlink_t
st_nlink
;
/* number of hard links */
uid_t
st_uid
;
/* user ID of owner */
gid_t
st_gid
;
/* group ID of owner */
dev_t
st_rdev
;
/* device type (if inode device) */
off64_t
st_size
;
/* total size, in bytes */
unsigned
long
st_blksize
;
/* blocksize for filesystem I/O */
unsigned
long
st_blocks
;
/* number of blocks allocated */
time_t
st_atime
;
/* time of last access */
time_t
st_mtime
;
/* time of last modification */
time_t
st_ctime
;
/* time of last change */
};
#endif
#ifndef HAVE_LSEEK64
extern
off64_t
lseek64
(
int
fildes
,
off64_t
offset
,
int
whence
);
#endif
#ifndef HAVE_STAT64
extern
int
stat64
(
const
char
*
file_name
,
struct
stat64
*
buf
);
#endif
#ifndef HAVE_LSTAT64
extern
int
lstat64
(
const
char
*
file_name
,
struct
stat64
*
buf
);
#endif
#ifndef HAVE_FSTAT64
extern
int
fstat64
(
int
fd
,
struct
stat64
*
buf
);
#endif
#ifndef HAVE_FTRUNCATE64
extern
int
ftruncate64
(
int
fd
,
off64_t
offset
);
#endif
#ifndef O_LARGEFILE
# define O_LARGEFILE 0
#endif
extern
void
*
wine_dlopen
(
const
char
*
filename
,
int
flag
,
char
*
error
,
int
errorsize
);
extern
void
*
wine_dlsym
(
void
*
handle
,
const
char
*
symbol
,
char
*
error
,
int
errorsize
);
extern
int
wine_dlclose
(
void
*
handle
,
char
*
error
,
int
errorsize
);
...
...
library/loader.c
View file @
3f1ed52d
...
...
@@ -5,6 +5,7 @@
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
...
...
@@ -18,7 +19,6 @@
#include "winnt.h"
#include "wine/library.h"
#include "wine/port.h"
#define MAX_DLLS 100
...
...
library/port.c
View file @
3f1ed52d
...
...
@@ -5,6 +5,7 @@
*/
#include "config.h"
#include "wine/port.h"
#ifdef __BEOS__
#include <be/kernel/fs_info.h>
...
...
@@ -43,7 +44,6 @@
# include <dlfcn.h>
#endif
#include "wine/port.h"
/***********************************************************************
* usleep
...
...
@@ -389,8 +389,94 @@ int lstat(const char *file_name, struct stat *buf)
}
#endif
/* HAVE_LSTAT */
static
void
_convert_stat_stat64
(
struct
stat64
*
stto
,
struct
stat
*
stfrom
)
{
stto
->
st_dev
=
stfrom
->
st_dev
;
stto
->
st_ino
=
stfrom
->
st_ino
;
stto
->
st_mode
=
stfrom
->
st_mode
;
stto
->
st_nlink
=
stfrom
->
st_nlink
;
stto
->
st_uid
=
stfrom
->
st_uid
;
stto
->
st_gid
=
stfrom
->
st_gid
;
stto
->
st_rdev
=
stfrom
->
st_rdev
;
stto
->
st_blksize
=
stfrom
->
st_blksize
;
stto
->
st_blocks
=
stfrom
->
st_blocks
;
stto
->
st_atime
=
stfrom
->
st_atime
;
stto
->
st_mtime
=
stfrom
->
st_mtime
;
stto
->
st_ctime
=
stfrom
->
st_ctime
;
stto
->
st_size
=
(
off64_t
)
stfrom
->
st_size
;
}
/***********************************************************************
* stat64
*/
#ifndef HAVE_STAT64
int
stat64
(
const
char
*
file_name
,
struct
stat64
*
buf
)
{
struct
stat
stbuf
;
int
res
=
stat
(
file_name
,
&
stbuf
);
_convert_stat_stat64
(
buf
,
&
stbuf
);
return
res
;
}
#endif
/* HAVE_STAT64 */
/***********************************************************************
* lstat64
*/
#ifndef HAVE_LSTAT64
int
lstat64
(
const
char
*
file_name
,
struct
stat64
*
buf
)
{
struct
stat
stbuf
;
int
res
=
lstat
(
file_name
,
&
stbuf
);
_convert_stat_stat64
(
buf
,
&
stbuf
);
return
res
;
}
#endif
/* HAVE_LSTAT64 */
/***********************************************************************
* fstat64
*/
#ifndef HAVE_FSTAT64
int
fstat64
(
int
fd
,
struct
stat64
*
buf
)
{
struct
stat
stbuf
;
int
res
=
fstat
(
fd
,
&
stbuf
);
_convert_stat_stat64
(
buf
,
&
stbuf
);
return
res
;
}
#endif
/* HAVE_FSTAT */
/***********************************************************************
* lseek64
*/
#ifndef HAVE_LSEEK64
off64_t
lseek64
(
int
fd
,
off64_t
where
,
int
whence
)
{
off_t
res
;
if
((
where
>=
0x8000000LL
)
||
(
where
<=
-
0x7fffffffLL
))
{
errno
=
EFBIG
;
/* FIXME: hack */
return
-
1
;
}
res
=
lseek
(
fd
,(
off_t
)
where
,
whence
);
return
(
off64_t
)
res
;
}
#endif
/* HAVE_LSEEK64 */
/***********************************************************************
* ftruncate64
*/
#ifndef HAVE_FTRUNCATE64
int
ftruncate64
(
int
fd
,
off64_t
where
)
{
if
((
where
>=
0x8000000LL
)
||
(
where
<=
-
0x7fffffffLL
))
{
errno
=
EFBIG
;
/* FIXME: hack */
return
-
1
;
}
return
ftruncate
(
fd
,(
off_t
)
where
);
}
#endif
/* HAVE_LSEEK64 */
/***********************************************************************
* getrlimit
*/
#ifndef HAVE_GETRLIMIT
...
...
loader/dos/dosmod.c
View file @
3f1ed52d
...
...
@@ -21,7 +21,6 @@ asm(".org 0x110000");
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
...
...
loader/ne/resource.c
View file @
3f1ed52d
...
...
@@ -10,7 +10,6 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "windef.h"
...
...
loader/ne/segment.c
View file @
3f1ed52d
...
...
@@ -9,7 +9,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
...
...
msdos/int13.c
View file @
3f1ed52d
...
...
@@ -5,11 +5,10 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#ifdef linux
#include <linux/fd.h>
#
include <linux/fd.h>
#endif
#include "miscemu.h"
/* #define DEBUG_INT */
...
...
msdos/int21.c
View file @
3f1ed52d
...
...
@@ -12,7 +12,6 @@
# include <sys/file.h>
#endif
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
...
...
server/console.c
View file @
3f1ed52d
...
...
@@ -15,10 +15,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
...
...
server/file.c
View file @
3f1ed52d
...
...
@@ -5,6 +5,7 @@
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <fcntl.h>
...
...
@@ -152,7 +153,7 @@ static struct file *create_file( const char *nameptr, size_t len, unsigned int a
}
/* FIXME: should set error to STATUS_OBJECT_NAME_COLLISION if file existed before */
if
((
fd
=
open
(
name
,
flags
|
O_NONBLOCK
,
if
((
fd
=
open
(
name
,
flags
|
O_NONBLOCK
|
O_LARGEFILE
,
(
attrs
&
FILE_ATTRIBUTE_READONLY
)
?
0444
:
0666
))
==
-
1
)
goto
file_error
;
/* refuse to open a directory */
...
...
@@ -161,7 +162,7 @@ static struct file *create_file( const char *nameptr, size_t len, unsigned int a
{
set_error
(
STATUS_ACCESS_DENIED
);
goto
error
;
}
}
if
(
!
(
file
=
create_file_for_fd
(
fd
,
access
,
sharing
,
attrs
)))
{
...
...
@@ -258,11 +259,11 @@ static int file_flush( struct object *obj )
static
int
file_get_info
(
struct
object
*
obj
,
struct
get_file_info_request
*
req
)
{
struct
stat
st
;
struct
stat
64
st
;
struct
file
*
file
=
(
struct
file
*
)
obj
;
assert
(
obj
->
ops
==
&
file_ops
);
if
(
fstat
(
file
->
obj
.
fd
,
&
st
)
==
-
1
)
if
(
fstat
64
(
file
->
obj
.
fd
,
&
st
)
==
-
1
)
{
file_set_error
();
return
0
;
...
...
@@ -275,8 +276,16 @@ static int file_get_info( struct object *obj, struct get_file_info_request *req
if
(
!
(
st
.
st_mode
&
S_IWUSR
))
req
->
attr
|=
FILE_ATTRIBUTE_READONLY
;
req
->
access_time
=
st
.
st_atime
;
req
->
write_time
=
st
.
st_mtime
;
req
->
size_high
=
0
;
req
->
size_low
=
S_ISDIR
(
st
.
st_mode
)
?
0
:
st
.
st_size
;
if
(
S_ISDIR
(
st
.
st_mode
))
{
req
->
size_high
=
0
;
req
->
size_low
=
0
;
}
else
{
req
->
size_high
=
st
.
st_size
>>
32
;
req
->
size_low
=
st
.
st_size
&
0xffffffff
;
}
req
->
links
=
st
.
st_nlink
;
req
->
index_high
=
st
.
st_dev
;
req
->
index_low
=
st
.
st_ino
;
...
...
@@ -331,21 +340,15 @@ struct file *get_file_obj( struct process *process, handle_t handle, unsigned in
return
(
struct
file
*
)
get_handle_obj
(
process
,
handle
,
access
,
&
file_ops
);
}
static
int
set_file_pointer
(
handle_t
handle
,
int
*
low
,
int
*
high
,
int
whence
)
static
int
set_file_pointer
(
handle_t
handle
,
unsigned
int
*
low
,
int
*
high
,
int
whence
)
{
struct
file
*
file
;
int
result
;
if
((
*
low
>=
0
&&
*
high
!=
0
)
||
(
*
low
<
0
&&
*
high
!=
-
1
))
{
fprintf
(
stderr
,
"set_file_pointer: offset > 2Gb not supported yet
\n
"
);
set_error
(
STATUS_INVALID_PARAMETER
);
return
0
;
}
off64_t
result
,
xto
;
xto
=
*
low
+
((
off64_t
)
*
high
<<
32
);
if
(
!
(
file
=
get_file_obj
(
current
->
process
,
handle
,
0
)))
return
0
;
if
((
result
=
lseek
(
file
->
obj
.
fd
,
*
low
,
whence
))
==
-
1
)
if
((
result
=
lseek
64
(
file
->
obj
.
fd
,
xto
,
whence
))
==
-
1
)
{
/* Check for seek before start of file */
...
...
@@ -358,7 +361,8 @@ static int set_file_pointer( handle_t handle, int *low, int *high, int whence )
release_object
(
file
);
return
0
;
}
*
low
=
result
;
*
low
=
result
&
0xffffffff
;
*
high
=
result
>>
32
;
release_object
(
file
);
return
1
;
}
...
...
@@ -366,12 +370,12 @@ static int set_file_pointer( handle_t handle, int *low, int *high, int whence )
static
int
truncate_file
(
handle_t
handle
)
{
struct
file
*
file
;
in
t
result
;
off64_
t
result
;
if
(
!
(
file
=
get_file_obj
(
current
->
process
,
handle
,
GENERIC_WRITE
)))
return
0
;
if
(((
result
=
lseek
(
file
->
obj
.
fd
,
0
,
SEEK_CUR
))
==
-
1
)
||
(
ftruncate
(
file
->
obj
.
fd
,
result
)
==
-
1
))
if
(((
result
=
lseek
64
(
file
->
obj
.
fd
,
0
,
SEEK_CUR
))
==
-
1
)
||
(
ftruncate
64
(
file
->
obj
.
fd
,
result
)
==
-
1
))
{
file_set_error
();
release_object
(
file
);
...
...
@@ -384,20 +388,16 @@ static int truncate_file( handle_t handle )
/* try to grow the file to the specified size */
int
grow_file
(
struct
file
*
file
,
int
size_high
,
int
size_low
)
{
struct
stat
st
;
struct
stat64
st
;
off64_t
size
=
size_low
+
(((
off64_t
)
size_high
)
<<
32
);
if
(
size_high
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
0
;
}
if
(
fstat
(
file
->
obj
.
fd
,
&
st
)
==
-
1
)
if
(
fstat64
(
file
->
obj
.
fd
,
&
st
)
==
-
1
)
{
file_set_error
();
return
0
;
}
if
(
st
.
st_size
>=
size
_low
)
return
1
;
/* already large enough */
if
(
ftruncate
(
file
->
obj
.
fd
,
size_low
)
!=
-
1
)
return
1
;
if
(
st
.
st_size
>=
size
)
return
1
;
/* already large enough */
if
(
ftruncate
64
(
file
->
obj
.
fd
,
size
)
!=
-
1
)
return
1
;
file_set_error
();
return
0
;
}
...
...
server/pipe.c
View file @
3f1ed52d
...
...
@@ -14,7 +14,6 @@
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
...
...
server/serial.c
View file @
3f1ed52d
...
...
@@ -20,7 +20,6 @@
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
...
...
server/sock.c
View file @
3f1ed52d
...
...
@@ -18,7 +18,6 @@
#ifdef HAVE_SYS_ERRNO_H
# include <sys/errno.h>
#endif
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
...
...
win32/device.c
View file @
3f1ed52d
...
...
@@ -9,16 +9,9 @@
#include "config.h"
#include <errno.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include <fcntl.h>
#include <string.h>
#include <stdarg.h>
#include <time.h>
...
...
win32/file.c
View file @
3f1ed52d
...
...
@@ -5,6 +5,7 @@
*/
#include "config.h"
#include "wine/port.h"
#include <errno.h>
#ifdef HAVE_SYS_ERRNO_H
...
...
@@ -56,7 +57,7 @@ BOOL16 WINAPI SetFileAttributes16( LPCSTR lpFileName, DWORD attributes )
*/
BOOL
WINAPI
SetFileAttributesA
(
LPCSTR
lpFileName
,
DWORD
attributes
)
{
struct
stat
buf
;
struct
stat
64
buf
;
DOS_FULL_NAME
full_name
;
if
(
!
DOSFS_GetFullName
(
lpFileName
,
TRUE
,
&
full_name
))
...
...
@@ -69,7 +70,7 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes)
FIXME
(
"(%s):%lx illegal combination with FILE_ATTRIBUTE_NORMAL.
\n
"
,
lpFileName
,
attributes
);
}
if
(
stat
(
full_name
.
long_name
,
&
buf
)
==-
1
)
if
(
stat
64
(
full_name
.
long_name
,
&
buf
)
==-
1
)
{
FILE_SetDosError
();
return
FALSE
;
...
...
windows/clipboard.c
View file @
3f1ed52d
...
...
@@ -19,7 +19,6 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment