* libc/include/utime.h: Add include of <_ansi.h>.
* libc/sys/linux/Makefile.am: Add utimes.c.
* libc/sys/linux/Makefile.in: Regenerated.
* libc/sys/linux/inode.c(__umask): New static routine.
(umask): Written to use __umask and attempt to thread lock.
(getumask): New function written to use __umask and thread lock.
* libc/sys/linux/utimes.c: New file.
* libc/sys/linux/sys/time.h: Fix utimes prototype.
* libc/sys/linux/sys/utime.h: New file.
+2002-07-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/include/utime.h: Add include of <_ansi.h>.
+ * libc/sys/linux/Makefile.am: Add utimes.c.
+ * libc/sys/linux/Makefile.in: Regenerated.
+ * libc/sys/linux/inode.c(__umask): New static routine.
+ (umask): Written to use __umask and attempt to thread lock.
+ (getumask): New function written to use __umask and thread lock.
+ * libc/sys/linux/utimes.c: New file.
+ * libc/sys/linux/sys/time.h: Fix utimes prototype.
+ * libc/sys/linux/sys/utime.h: New file.
+
2002-07-04 Thomas Fitzsimmons <fitzsim@redhat.com>
* libtool.m4: New file.
extern "C" {
#endif
+#include <_ansi.h>
+
/* The utime function is defined in libc/sys/<arch>/sys if it exists. */
#include <sys/utime.h>
termios.c \
time.c \
usleep.c \
+ utimes.c \
wait.c
# This will handle both /usr/src/linux-2.4/include/asm/signal.h (in Red Hat Linux 7.1)
termios.c \
time.c \
usleep.c \
+ utimes.c \
wait.c
@USE_LIBTOOL_FALSE@sysconf.$(OBJEXT) sysctl.$(OBJEXT) systat.$(OBJEXT) \
@USE_LIBTOOL_FALSE@system.$(OBJEXT) tcdrain.$(OBJEXT) \
@USE_LIBTOOL_FALSE@tcsendbrk.$(OBJEXT) termios.$(OBJEXT) time.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@usleep.$(OBJEXT) wait.$(OBJEXT)
+@USE_LIBTOOL_FALSE@usleep.$(OBJEXT) utimes.$(OBJEXT) wait.$(OBJEXT)
LTLIBRARIES = $(noinst_LTLIBRARIES)
@USE_LIBTOOL_TRUE@liblinux_la_OBJECTS = aio.lo brk.lo cfspeed.lo \
@USE_LIBTOOL_TRUE@sigset.lo sigwait.lo socket.lo sleep.lo stack.lo \
@USE_LIBTOOL_TRUE@strsignal.lo sysconf.lo sysctl.lo systat.lo system.lo \
@USE_LIBTOOL_TRUE@tcdrain.lo tcsendbrk.lo termios.lo time.lo usleep.lo \
-@USE_LIBTOOL_TRUE@wait.lo
+@USE_LIBTOOL_TRUE@utimes.lo wait.lo
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in \
- ../../../acinclude.m4 ../../../aclocal.m4 \
- ../../../libtool.m4
+ ../../../acinclude.m4 ../../../aclocal.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
#include <sys/stat.h>
#include <sys/utime.h>
#include <linux/dirent.h>
+#include <sys/lock.h>
#include <machine/syscall.h>
+__LOCK_INIT(static, umask_lock);
+
+#define __NR___umask __NR_umask
_syscall2(int,link,const char *,oldpath,const char *,newpath)
_syscall1(int,unlink,const char *,pathname)
_syscall2(int,mkdir,const char *,pathname,mode_t,mode)
_syscall1(int,rmdir,const char *,pathname)
_syscall1(int,pipe,int *,filedes)
-_syscall1(mode_t,umask,mode_t,mask)
_syscall1(int,chroot,const char *,path)
_syscall2(int,symlink,const char *,oldpath,const char *,newpath)
_syscall3(int,readlink,const char *,path,char *,buf,size_t,bufsiz)
_syscall2(int,lstat,const char *,file_name,struct stat *,buf)
_syscall2(int,fstat,int,filedes,struct stat *,buf)
_syscall3(int,getdents,int,fd,struct dirent *,dirp,unsigned int,count)
+_syscall1(mode_t,__umask,mode_t,mask)
+
+static _syscall3(int,fchown32,int,fd,uid_t,owner,gid_t,group)
+
+int
+fchown (int fd, uid_t owner, gid_t group)
+{
+ return __libc_fchown32 (fd, owner, group);
+}
+
+mode_t
+umask (mode_t mask)
+{
+ mode_t old_mask;
+
+ /* we need to lock so as to not interfere with getumask */
+ __lock_acquire(umask_lock);
+ old_mask = __umask (mask);
+ __lock_release(umask_lock);
+
+ return old_mask;
+}
+
+mode_t
+getumask (void)
+{
+ mode_t mask;
+
+ __lock_acquire(umask_lock);
+
+ mask = __umask (0);
+ mask = __umask (mask);
+
+ __lock_release(umask_lock);
+
+ return mask;
+}
+
int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__z));
int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *));
-int _EXFUN(utimes, (const char *__path, struct timeval *__tvp));
+int _EXFUN(utimes, (const char *__path, const struct timeval __tvp[2]));
int _EXFUN(getitimer, (int __which, struct itimerval *__value));
int _EXFUN(setitimer, (int __which, const struct itimerval *__value,
struct itimerval *__ovalue));
--- /dev/null
+#ifndef _SYS_UTIME_H
+#define _SYS_UTIME_H 1
+
+#include <sys/types.h>
+
+struct utimbuf
+ {
+ time_t actime; /* Access time. */
+ time_t modtime; /* Modification time. */
+ };
+
+int _EXFUN(utime, (const char *__file, const struct utimbuf *__times));
+
+#endif /* _SYS_UTIME_H */
--- /dev/null
+/* Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <utime.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <stddef.h>
+#include <machine/weakalias.h>
+
+/* Change the access time of FILE to TVP[0] and
+ the modification time of FILE to TVP[1]. */
+int
+__utimes (const char *file, const struct timeval tvp[2])
+{
+ struct utimbuf buf, *times;
+
+ if (tvp)
+ {
+ times = &buf;
+ times->actime = tvp[0].tv_sec + tvp[0].tv_usec / 1000000;
+ times->modtime = tvp[1].tv_sec + tvp[1].tv_usec / 1000000;
+ }
+ else
+ times = NULL;
+
+ return utime (file, times);
+}
+
+weak_alias (__utimes, utimes)