Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4668d54f
Commit
4668d54f
authored
Oct 24, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fseeko for NetBSD.
parent
d36caf10
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
12 deletions
+24
-12
configure
configure
+3
-2
configure.in
configure.in
+4
-3
src/include/c.h
src/include/c.h
+2
-2
src/port/fseeko.c
src/port/fseeko.c
+15
-5
No files found.
configure
View file @
4668d54f
...
@@ -10543,9 +10543,10 @@ done
...
@@ -10543,9 +10543,10 @@ done
# BSD/OS
has
a custom fseeko/ftello built on fsetpos/fgetpos
# BSD/OS
& NetBSD use
a custom fseeko/ftello built on fsetpos/fgetpos
# We override the previous test that said fseeko/ftello didn't exist
# We override the previous test that said fseeko/ftello didn't exist
case
$host_os
in
bsdi
*
)
# OS tests are also done in include/c.h and port/fseeko.c
case
$host_os
in
bsdi
*
|
netbsd
*
)
ac_cv_func_fseeko
=
yes
ac_cv_func_fseeko
=
yes
esac
esac
...
...
configure.in
View file @
4668d54f
dnl Process this file with autoconf to produce a configure script.
dnl Process this file with autoconf to produce a configure script.
dnl $Header: /cvsroot/pgsql/configure.in,v 1.21
5 2002/10/24 03:03:37
momjian Exp $
dnl $Header: /cvsroot/pgsql/configure.in,v 1.21
6 2002/10/24 03:11:05
momjian Exp $
dnl
dnl
dnl Developers, please strive to achieve this order:
dnl Developers, please strive to achieve this order:
dnl
dnl
...
@@ -837,9 +837,10 @@ fi
...
@@ -837,9 +837,10 @@ fi
AC_REPLACE_FUNCS([fseeko gethostname getrusage inet_aton random srandom strcasecmp strdup strerror strtol strtoul])
AC_REPLACE_FUNCS([fseeko gethostname getrusage inet_aton random srandom strcasecmp strdup strerror strtol strtoul])
# BSD/OS
has
a custom fseeko/ftello built on fsetpos/fgetpos
# BSD/OS
& NetBSD use
a custom fseeko/ftello built on fsetpos/fgetpos
# We override the previous test that said fseeko/ftello didn't exist
# We override the previous test that said fseeko/ftello didn't exist
case $host_os in bsdi*)
# OS tests are also done in include/c.h and port/fseeko.c
case $host_os in bsdi*|netbsd*)
ac_cv_func_fseeko=yes
ac_cv_func_fseeko=yes
esac
esac
...
...
src/include/c.h
View file @
4668d54f
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: c.h,v 1.1
29 2002/10/23 23:37:47
momjian Exp $
* $Id: c.h,v 1.1
30 2002/10/24 03:11:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -639,7 +639,7 @@ typedef NameData *Name;
...
@@ -639,7 +639,7 @@ typedef NameData *Name;
#include <unistd.h>
#include <unistd.h>
#endif
#endif
#if defined(bsdi)
#if defined(bsdi)
|| defined(netbsd)
int
fseeko
(
FILE
*
stream
,
off_t
offset
,
int
whence
);
int
fseeko
(
FILE
*
stream
,
off_t
offset
,
int
whence
);
off_t
ftello
(
FILE
*
stream
);
off_t
ftello
(
FILE
*
stream
);
#endif
#endif
...
...
src/port/fseeko.c
View file @
4668d54f
...
@@ -8,12 +8,12 @@
...
@@ -8,12 +8,12 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.
3 2002/10/23 21:39:27
momjian Exp $
* $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.
4 2002/10/24 03:11:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#if
def __bsdi__
#if
defined(bsdi) || defined(netbsd)
#include <pthread.h>
#include <pthread.h>
#include <stdio.h>
#include <stdio.h>
...
@@ -22,11 +22,11 @@
...
@@ -22,11 +22,11 @@
#include <errno.h>
#include <errno.h>
/*
/*
* On BSD/OS
, off_t and fpos_t are the same. Standards say
* On BSD/OS
and NetBSD, off_t and fpos_t are the same. Standards
* off_t is an arithmetic type, but not necessarily integral,
*
say
off_t is an arithmetic type, but not necessarily integral,
* while fpos_t might be neither.
* while fpos_t might be neither.
*
*
* This is thread-safe using flockfile/funlockfile.
* This is thread-safe
on BSD/OS
using flockfile/funlockfile.
*/
*/
int
int
...
@@ -38,13 +38,17 @@ fseeko(FILE *stream, off_t offset, int whence)
...
@@ -38,13 +38,17 @@ fseeko(FILE *stream, off_t offset, int whence)
switch
(
whence
)
switch
(
whence
)
{
{
case
SEEK_CUR
:
case
SEEK_CUR
:
#ifdef bsdi
flockfile
(
stream
);
flockfile
(
stream
);
#endif
if
(
fgetpos
(
stream
,
&
floc
)
!=
0
)
if
(
fgetpos
(
stream
,
&
floc
)
!=
0
)
goto
failure
;
goto
failure
;
floc
+=
offset
;
floc
+=
offset
;
if
(
fsetpos
(
stream
,
&
floc
)
!=
0
)
if
(
fsetpos
(
stream
,
&
floc
)
!=
0
)
goto
failure
;
goto
failure
;
#ifdef bsdi
flockfile
(
stream
);
flockfile
(
stream
);
#endif
return
0
;
return
0
;
break
;
break
;
case
SEEK_SET
:
case
SEEK_SET
:
...
@@ -53,13 +57,17 @@ fseeko(FILE *stream, off_t offset, int whence)
...
@@ -53,13 +57,17 @@ fseeko(FILE *stream, off_t offset, int whence)
return
0
;
return
0
;
break
;
break
;
case
SEEK_END
:
case
SEEK_END
:
#ifdef bsdi
flockfile
(
stream
);
flockfile
(
stream
);
#endif
if
(
fstat
(
fileno
(
stream
),
&
filestat
)
!=
0
)
if
(
fstat
(
fileno
(
stream
),
&
filestat
)
!=
0
)
goto
failure
;
goto
failure
;
floc
=
filestat
.
st_size
;
floc
=
filestat
.
st_size
;
if
(
fsetpos
(
stream
,
&
floc
)
!=
0
)
if
(
fsetpos
(
stream
,
&
floc
)
!=
0
)
goto
failure
;
goto
failure
;
#ifdef bsdi
funlockfile
(
stream
);
funlockfile
(
stream
);
#endif
return
0
;
return
0
;
break
;
break
;
default:
default:
...
@@ -68,7 +76,9 @@ fseeko(FILE *stream, off_t offset, int whence)
...
@@ -68,7 +76,9 @@ fseeko(FILE *stream, off_t offset, int whence)
}
}
failure:
failure:
#ifdef bsdi
funlockfile
(
stream
);
funlockfile
(
stream
);
#endif
return
-
1
;
return
-
1
;
}
}
...
...
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