• Fwd: Fwd: Bug report -- utimes()

    From [via djgpp@delorie.com]" @21:1/5 to A. Wik on Sat Jul 25 18:58:55 2020
    Reply from Schilling:

    ---------- Forwarded message ---------
    From: Joerg Schilling <schily@schily.net>
    Date: Sat, 25 Jul 2020 at 18:10
    Subject: Re: Fwd: Bug report -- utimes()
    To: <awik32@gmail.com>, <joerg@schily.net>


    "A. Wik" <awik32@gmail.com> wrote:

    Hi,

    I received this reply to the utimes() bug report you asked me to forward.

    ---------- Forwarded message ---------
    From: Juan Manuel Guerrero (juan.guerrero@gmx.de) [via
    djgpp@delorie.com] <djgpp@delorie.com>
    Date: Sat, 25 Jul 2020 at 16:49
    Subject: Re: Bug report -- utimes()
    To: <djgpp@delorie.com>
    ..

    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:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sun Jul 26 15:57:25 2020
    Am 25.07.2020 20:58, schrieb A. Wik (awik32@gmail.com) [via djgpp@delorie.com]:
    Reply from Schilling:

    ---------- Forwarded message ---------
    From: Joerg Schilling<schily@schily.net>
    Date: Sat, 25 Jul 2020 at 18:10
    Subject: Re: Fwd: Bug report -- utimes() To:<awik32@gmail.com>,<joerg@schily.net>


    "A. Wik"<awik32@gmail.com> wrote:

    Hi,

    I received this reply to the utimes() bug report you asked me to forward.

    ---------- Forwarded message ---------
    From: Juan Manuel Guerrero (juan.guerrero@gmx.de) [via
    djgpp@delorie.com]<djgpp@delorie.com>
    Date: Sat, 25 Jul 2020 at 16:49
    Subject: Re: Bug report -- utimes()
    To:<djgpp@delorie.com>
    ...

    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:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (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 <juan.guerrero@gmx.de>

    * 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
    =====