about summary refs log tree commit diff
path: root/sysdeps/generic/utmp_file.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-13 22:17:17 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-13 22:17:17 +0000
commit2958e6cc5f39ac2487b4fcbc2db48462a34ce23d (patch)
tree6a55d2abeae2e9ba1b5412c591743fdd733832ab /sysdeps/generic/utmp_file.c
parentf1a26a85046fa11da2ea51aa6d4edfbfc8549c39 (diff)
downloadglibc-2958e6cc5f39ac2487b4fcbc2db48462a34ce23d.tar.gz
glibc-2958e6cc5f39ac2487b4fcbc2db48462a34ce23d.tar.xz
glibc-2958e6cc5f39ac2487b4fcbc2db48462a34ce23d.zip
Update.
	* io/ftw.c: Always use readdir64.
	* io/ftw64.c: Likewise.
	* sysdeps/unix/sysv/linux/ttyname.c: Likewise.
	* sysdeps/unix/sysv/linux/ttyname_r.c: Likewise.
	* sysdeps/generic/glob.c: Likewise.  Convert results if gl_readdir
	callback to dirent.  Still allow compiling outside glibc.
	* sysdeps/gnu/glob64.c: Define COMPILE_GLOB64.
	* sysdeps/unix/sysv/linux/i386/glob64.c: Likewise.

	* malloc/mtrace.c: Use fopen64.
	* posix/spawni.c: Use __open64.
	* sysdeps/unix/opendir.c: Likewise.
	* sysdeps/unix/sysv/linux/gethostid.c: Likewise.

	* sysdeps/generic/ftruncate64.c: Define __ftruncate64 and make old
	name a weak alias.
	* sysdeps/unix/sysv/aix/ftruncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/ftruncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/ftruncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/ftruncate64.c: Likewise.

	* resolv/res_data.c: Add cast to avoid warning.

	* include/unistd.h: Declare __ftruncate64.

	* sysdeps/generic/utmp_file.c: Use LFS functions and type.
Diffstat (limited to 'sysdeps/generic/utmp_file.c')
-rw-r--r--sysdeps/generic/utmp_file.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sysdeps/generic/utmp_file.c b/sysdeps/generic/utmp_file.c
index 2f172ffdbe..60178b3155 100644
--- a/sysdeps/generic/utmp_file.c
+++ b/sysdeps/generic/utmp_file.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>
    and Paul Janzen <pcj@primenet.com>, 1996.
@@ -32,7 +32,7 @@
 
 /* Descriptor for the file and position.  */
 static int file_fd = -1;
-static off_t file_offset;
+static off64_t file_offset;
 
 /* Cache for the last read entry.  */
 static struct utmp last_entry;
@@ -138,7 +138,7 @@ setutent_file (void)
 	}
     }
 
-  __lseek (file_fd, 0, SEEK_SET);
+  __lseek64 (file_fd, 0, SEEK_SET);
   file_offset = 0;
 
 #if _HAVE_UT_TYPE - 0
@@ -384,13 +384,13 @@ pututline_file (const struct utmp *data)
   if (found < 0)
     {
       /* We append the next entry.  */
-      file_offset = __lseek (file_fd, 0, SEEK_END);
+      file_offset = __lseek64 (file_fd, 0, SEEK_END);
       if (file_offset % sizeof (struct utmp) != 0)
 	{
 	  file_offset -= file_offset % sizeof (struct utmp);
-	  __ftruncate (file_fd, file_offset);
+	  __ftruncate64 (file_fd, file_offset);
 
-	  if (__lseek (file_fd, 0, SEEK_END) < 0)
+	  if (__lseek64 (file_fd, 0, SEEK_END) < 0)
 	    {
 	      pbuf = NULL;
 	      goto unlock_return;
@@ -401,7 +401,7 @@ pututline_file (const struct utmp *data)
     {
       /* We replace the just read entry.  */
       file_offset -= sizeof (struct utmp);
-      __lseek (file_fd, file_offset, SEEK_SET);
+      __lseek64 (file_fd, file_offset, SEEK_SET);
     }
 
   /* Write the new data.  */
@@ -410,7 +410,7 @@ pututline_file (const struct utmp *data)
       /* If we appended a new record this is only partially written.
 	 Remove it.  */
       if (found < 0)
-	(void) __ftruncate (file_fd, file_offset);
+	(void) __ftruncate64 (file_fd, file_offset);
       pbuf = NULL;
     }
   else
@@ -440,7 +440,7 @@ static int
 updwtmp_file (const char *file, const struct utmp *utmp)
 {
   int result = -1;
-  off_t offset;
+  off64_t offset;
   int fd;
 
   /* Open WTMP file.  */
@@ -451,13 +451,13 @@ updwtmp_file (const char *file, const struct utmp *utmp)
   LOCK_FILE (fd, F_WRLCK);
 
   /* Remember original size of log file.  */
-  offset = __lseek (fd, 0, SEEK_END);
+  offset = __lseek64 (fd, 0, SEEK_END);
   if (offset % sizeof (struct utmp) != 0)
     {
       offset -= offset % sizeof (struct utmp);
-      __ftruncate (fd, offset);
+      __ftruncate64 (fd, offset);
 
-      if (__lseek (fd, 0, SEEK_END) < 0)
+      if (__lseek64 (fd, 0, SEEK_END) < 0)
 	goto unlock_return;
     }
 
@@ -466,7 +466,7 @@ updwtmp_file (const char *file, const struct utmp *utmp)
      will remain.  */
   if (__write (fd, utmp, sizeof (struct utmp)) != sizeof (struct utmp))
     {
-      __ftruncate (fd, offset);
+      __ftruncate64 (fd, offset);
       goto unlock_return;
     }