8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.8 2003/01/0206:00:33 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.9 2003/01/0223:22:49 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
21
21
22
22
#include "c.h"
23
23
24
- #ifdef bsdi
25
24
#include <pthread.h>
26
- #endif
27
25
#include <stdio.h>
28
26
#include <sys/types.h>
29
27
#include <sys/stat.h>
@@ -46,17 +44,13 @@ fseeko(FILE *stream, off_t offset, int whence)
46
44
switch (whence )
47
45
{
48
46
case SEEK_CUR :
49
- #ifdef bsdi
50
47
flockfile (stream );
51
- #endif
52
48
if (fgetpos (stream ,& floc )!= 0 )
53
49
gotofailure ;
54
50
floc += offset ;
55
51
if (fsetpos (stream ,& floc )!= 0 )
56
52
gotofailure ;
57
- #ifdef bsdi
58
53
funlockfile (stream );
59
- #endif
60
54
return 0 ;
61
55
break ;
62
56
case SEEK_SET :
@@ -65,17 +59,13 @@ fseeko(FILE *stream, off_t offset, int whence)
65
59
return 0 ;
66
60
break ;
67
61
case SEEK_END :
68
- #ifdef bsdi
69
62
flockfile (stream );
70
- #endif
71
63
if (fstat (fileno (stream ),& filestat )!= 0 )
72
64
gotofailure ;
73
65
floc = filestat .st_size ;
74
66
if (fsetpos (stream ,& floc )!= 0 )
75
67
gotofailure ;
76
- #ifdef bsdi
77
68
funlockfile (stream );
78
- #endif
79
69
return 0 ;
80
70
break ;
81
71
default :
@@ -84,9 +74,7 @@ fseeko(FILE *stream, off_t offset, int whence)
84
74
}
85
75
86
76
failure :
87
- #ifdef bsdi
88
77
funlockfile (stream );
89
- #endif
90
78
return -1 ;
91
79
}
92
80