public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi@etezian.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t 3/5] i915: Exercise preemption timeout controls in sysfs
Date: Sat, 29 Feb 2020 14:45:27 +0200	[thread overview]
Message-ID: <20200229124527.GG11891@jack.zhora.eu> (raw)
In-Reply-To: <158297170388.24106.996217556546669029@skylake-alporthouse-com>

> > > > > +     char buf[512];
> > > > > +     int len;
> > > > > +
> > > > > +     lseek(engines, 0, SEEK_SET);
> > > > > +     while ((len = syscall(SYS_getdents64, engines, buf, sizeof(buf))) > 0) {
> > > > > +             void *ptr = buf;
> > > > > +
> > > > > +             while (len) {
> > > > > +                     struct linux_dirent64 {
> > > > > +                             ino64_t        d_ino;
> > > > > +                             off64_t        d_off;
> > > > > +                             unsigned short d_reclen;
> > > > > +                             unsigned char  d_type;
> > > > > +                             char           d_name[];
> > > > > +                     } *de = ptr;
> > > > 
> > > > what is the need for having your own linux_dirent64?
> > > 
> > > fdopendir() takes ownership of the fd, preventing reuse. And
> > > fdopendir(dup()) is getting ridiculous.
> > 
> > why not using dirent64?
> 
> It's still the same problem that it takes a DIR, assuming ownership of
> the fd. Why using linux_dirent64 because the manpage says so -- if you
> are going to use the syscall, you need to match it's calling
> conventions, not a middleman's.

I understand, but in bits/dirent.h there is, with some
assumptions, this part:

#ifdef __USE_LARGEFILE64
struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];           /* We must not include limits.h! */
  };
#endif

why redefine a struct linux_dirent64?

Andi

PS We have time until Monday morning to discuss this, right? :)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-02-29 12:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 10:43 [igt-dev] [PATCH i-g-t 1/5] i915: Start putting the mmio_base to wider use Chris Wilson
2020-02-28 10:43 ` [Intel-gfx] [PATCH i-g-t 2/5] i915/gem_ctx_isolation: Check engine relative registers Chris Wilson
2020-02-28 19:46   ` [igt-dev] " Stimson, Dale B
2020-02-28 10:43 ` [igt-dev] [PATCH i-g-t 3/5] i915: Exercise preemption timeout controls in sysfs Chris Wilson
2020-02-28 23:27   ` [Intel-gfx] " Andi Shyti
2020-02-28 23:32     ` [igt-dev] " Chris Wilson
2020-02-28 23:51       ` Andi Shyti
2020-02-29 10:21         ` [igt-dev] " Chris Wilson
2020-02-29 12:45           ` Andi Shyti [this message]
2020-02-29 18:34             ` Chris Wilson
2020-02-29 18:39               ` Chris Wilson
2020-02-28 10:43 ` [Intel-gfx] [PATCH i-g-t 4/5] i915: Exercise sysfs heartbeat controls Chris Wilson
2020-02-28 23:34   ` Andi Shyti
2020-02-28 23:37     ` [igt-dev] " Chris Wilson
2020-02-28 10:43 ` [igt-dev] [PATCH i-g-t 5/5] i915: Exercise timeslice sysfs property Chris Wilson
2020-02-28 11:15 ` [igt-dev] ✗ GitLab.Pipeline: failure for series starting with [i-g-t,1/5] i915: Start putting the mmio_base to wider use Patchwork
2020-02-28 11:52 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-02-28 19:45 ` [igt-dev] [PATCH i-g-t 1/5] " Stimson, Dale B
2020-02-28 21:27 ` Andi Shyti
2020-03-01  1:09 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/5] " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-03-11  9:34 [igt-dev] [PATCH i-g-t 1/5] lib/i915: Create a context wrapping one specific engine Chris Wilson
2020-03-11  9:34 ` [igt-dev] [PATCH i-g-t 3/5] i915: Exercise preemption timeout controls in sysfs Chris Wilson
2020-03-13 22:26   ` [Intel-gfx] " Andi Shyti

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=20200229124527.GG11891@jack.zhora.eu \
    --to=andi@etezian.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox