Am 25.07.2020 20:58, schrieb A. Wik (
[email protected]) [via
[email protected]]:
Reply from Schilling:
---------- Forwarded message ---------
From: Joerg Schilling<[email protected]>
Date: Sat, 25 Jul 2020 at 18:10
Subject: Re: Fwd: Bug report -- utimes() To:<[email protected]>,<[email protected]>
"A. Wik"<[email protected]> wrote:
Hi,
I received this reply to the utimes() bug report you asked me to forward.
---------- Forwarded message ---------
From: Juan Manuel Guerrero ([email protected]) [via
[email protected]]<[email protected]>
Date: Sat, 25 Jul 2020 at 16:49
Subject: Re: Bug report -- utimes()
To:<[email protected]>
...
Sorry, but I do not fully understannd this.
DJGPP provides utime() and utimes() that fully conform to 4.3BSD, POSIX.1-2001
with regards to their arguments. There is nothing like a const struct
timestruct
OK, this was a typo, but the problem seems to be a wrong protoype for utimes()
in DJGPP.
The bug is in
c:/djgpp/include/sys/time.h:41:46: note: expected 'struct timeval *' but argument is of type 'const struct timeval *'
41 | int utimes(const char *_file, struct timeval _tvp[2]);
and the standard says:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimes.html
Jörg
--
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/
Thank you for the clarification. The issue has been fixed.
Regards,
Juan M. Guerrero
2020-07-26 Juan Manuel Guerrero <
[email protected]>
* djgpp/include/sys/time.h: utimes prototype fixed.
Reported by Jörg Schilling and Albert Wik.
* djgpp/src/libc/compat/time/utimes.c: arguments of utimes fixed.
Reported by Jörg Schilling and Albert Wik.
* djgpp/src/libc/compat/time/utimes.txh: utimes prototype fixed.
Reported by Jörg Schilling and Albert Wik.
Index: djgpp/include/sys/time.h ===================================================================
RCS file: /cvs/djgpp/djgpp/include/sys/time.h,v
retrieving revision 1.6
diff -U 5 -r1.6 time.h
--- djgpp/include/sys/time.h 2 May 2015 07:31:58 -0000 1.6
+++ djgpp/include/sys/time.h 26 Jul 2020 13:38:05 -0000
@@ -1,5 +1,6 @@
+/* Copyright (C) 2020 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2012 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_time_h_
@@ -36,11 +37,11 @@
clock granularity. */
extern long __djgpp_clock_tick_interval;
int getitimer(int _which, struct itimerval *_value);
int setitimer(int _which, struct itimerval *_value, struct itimerval *_ovalue);
-int utimes(const char *_file, struct timeval _tvp[2]);
+int utimes(const char *_file, const struct timeval _tvp[2]);
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
Index: djgpp/src/libc/compat/time/utimes.c
=====