88 *
99 *
1010 * 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 $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
2121
2222#include "c.h"
2323
24- #ifdef bsdi
2524#include <pthread.h>
26- #endif
2725#include <stdio.h>
2826#include <sys/types.h>
2927#include <sys/stat.h>
@@ -46,17 +44,13 @@ fseeko(FILE *stream, off_t offset, int whence)
4644switch (whence )
4745{
4846case SEEK_CUR :
49- #ifdef bsdi
5047flockfile (stream );
51- #endif
5248if (fgetpos (stream ,& floc )!= 0 )
5349gotofailure ;
5450floc += offset ;
5551if (fsetpos (stream ,& floc )!= 0 )
5652gotofailure ;
57- #ifdef bsdi
5853funlockfile (stream );
59- #endif
6054return 0 ;
6155break ;
6256case SEEK_SET :
@@ -65,17 +59,13 @@ fseeko(FILE *stream, off_t offset, int whence)
6559return 0 ;
6660break ;
6761case SEEK_END :
68- #ifdef bsdi
6962flockfile (stream );
70- #endif
7163if (fstat (fileno (stream ),& filestat )!= 0 )
7264gotofailure ;
7365floc = filestat .st_size ;
7466if (fsetpos (stream ,& floc )!= 0 )
7567gotofailure ;
76- #ifdef bsdi
7768funlockfile (stream );
78- #endif
7969return 0 ;
8070break ;
8171default :
@@ -84,9 +74,7 @@ fseeko(FILE *stream, off_t offset, int whence)
8474}
8575
8676failure :
87- #ifdef bsdi
8877funlockfile (stream );
89- #endif
9078return -1 ;
9179}
9280