*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.9 2003/01/02 23:22:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.10 2003/01/11 19:38:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "c.h"
+#ifdef bsdi
#include <pthread.h>
+#endif
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
switch (whence)
{
case SEEK_CUR:
+#ifdef bsdi
flockfile(stream);
+#endif
if (fgetpos(stream, &floc) != 0)
goto failure;
floc += offset;
if (fsetpos(stream, &floc) != 0)
goto failure;
+#ifdef bsdi
funlockfile(stream);
+#endif
return 0;
break;
case SEEK_SET:
return 0;
break;
case SEEK_END:
+#ifdef bsdi
flockfile(stream);
+#endif
if (fstat(fileno(stream), &filestat) != 0)
goto failure;
floc = filestat.st_size;
if (fsetpos(stream, &floc) != 0)
goto failure;
+#ifdef bsdi
funlockfile(stream);
+#endif
return 0;
break;
default:
}
failure:
+#ifdef bsdi
funlockfile(stream);
+#endif
return -1;
}