All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH DRAFT] syscalls/stime: convert to new lib, use direct syscall
Date: Thu, 7 Mar 2019 14:02:52 +0800	[thread overview]
Message-ID: <5C80B40C.7070106@cn.fujitsu.com> (raw)
In-Reply-To: <20190301144831.GA16823@rei>

Hi Cyril, Steve

According to the source code of glibc, glibc implements stime() by 
__NR_settimeofday
instead of __NR_stime, and some arches(e.g. x86_64) don't define 
__NR_stime directly.
Therefore these updated tests will be skipped on some arches that don't 
define __NR_stime.

If glibc implements stime(), should we use it diectly?  If not, should 
we use __NR_stime or __NR_settimeofday?

Please see detail at sysdeps/unix/stime.c in glibc:
-------------------------------------------------------------------
int
stime (const time_t *when)
{
   struct timeval tv;

   if (when == NULL)
     {
       __set_errno (EINVAL);
       return -1;
     }

   tv.tv_sec = *when;
   tv.tv_usec = 0;
   return __settimeofday (&tv, (struct timezone *) 0);
-------------------------------------------------------------------

Best Regards,
Xiao Yang
On 2019/03/01 22:48, Cyril Hrubis wrote:
> Hi!
>> I set about cleaning up the stime tests but later realized I don't
>> have a platform that has the stime syscall so I cannot test this
>> patch fully. If someone else has such a platform (looks like 32-bit
>> x86 has it) and wants to take the patch over, feel free :) .
> I've taken over and finished the patchset, thanks.
>
> Also btw, you can test these testcases on x86_64 if you compile LTP with
> -m32 flag with:
>
> CFLAGS=-m32 LDFLAGS=-m32 ./configure
>




  reply	other threads:[~2019-03-07  6:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-02  1:59 [LTP] [PATCH DRAFT] syscalls/stime: convert to new lib, use direct syscall Steve Muckle
2019-03-01 14:48 ` Cyril Hrubis
2019-03-07  6:02   ` Xiao Yang [this message]
2019-03-12 17:51     ` Steve Muckle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5C80B40C.7070106@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.