unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 1/5] Linux: Add tables with system call numbers
Date: Tue, 31 Dec 2019 21:20:13 +0530	[thread overview]
Message-ID: <0b6f5557-e67f-b92f-269d-163c8df2d3c8@gotplt.org> (raw)
In-Reply-To: <87zhf8n3j4.fsf@mid.deneb.enyo.de>

On 31/12/19 4:52 pm, Florian Weimer wrote:
>> Prefix the auto-generated files with a comment header like so:
>>
>> /* AUTOGENERATED by update-syscall-lists.py. DO NOT EDIT. */
> 
> I'm concerned that this unnecessarily makes processing by tools more
> difficult, so I'd like to avoid this.

The tools only need to filter out \/\*.*\*\/ (or een simpler, omit the
first line if it's just for these files) which shouldn't be more than a
line or two of code.  Do you see any other challenges here?  It's a very
useful comment IMO and definitely worth the extra line of code one would
have to add to omit comments or even the first line.

> I copied the linux_kernel_version function from
> sysdeps/unix/sysv/linux/tst-mman-consts.py, which is why I kept the
> 2018 year.

OK.

>>> +    # Merge the architecture-specific system call names into the
>>> +    # global names list, syscall-names.list.  This file contains names
>>> +    # from other architectures (and comments), so it is necessary to
>>> +    # merge the existing files with the names obtained from the
>>> +    # kernel.
>>> +    with open(args.names_list, "r+") as list_file:
>>> +        os.lockf(list_file.fileno(), os.F_LOCK, 0)
>>> +        names_list = glibcsyscalls.SyscallNamesList(list_file)
>>> +        merged = names_list.merge(kernel_constants.keys())
>>> +        list_file.truncate()
>>> +        list_file.seek(0)
>>> +        for line in merged:
>>> +            list_file.write(line)
>>
>> I think the cleaner way would be to write out the output as a temp first
>> and then rename over the old file.  This ought to replicate what we do
>> in Makefiles.
> 
> But we need locking if this is used from build-many-glibcs.py,
> otherwise we'll lose updates even with the rename approach.  Locking
> the file being updated is the easiest way to achieve this.  It's true
> that we have data loss if the script is terminated between the
> truncate and seek, but most editors have the same issue.  Therefore, I
> want to leave this as-is.

It would be nice to make build-many-glibcs.py smarter about this.  The
problem with locking seems limited to syscall-names.list and not
arch-syscalls.h since the latter ought to be different files for
build-many-glibcs, right?

I don't want to hold up this patchset for it, but want to make sure we
at least fully understand and document the limitations for posterity.

> New patch below.  Commit message is unchanged.
> 

Rest looks OK, so lets find common ground on the above two points.

Siddhesh

  parent reply	other threads:[~2019-12-31 15:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 14:30 [PATCH 0/5] Implement built-in system call tables Florian Weimer
2019-12-17 14:30 ` [PATCH 1/5] Linux: Add tables with system call numbers Florian Weimer
2019-12-28 12:39   ` Siddhesh Poyarekar
2019-12-31 11:22     ` Florian Weimer
2019-12-31 13:57       ` Adhemerval Zanella
2019-12-31 16:48         ` Florian Weimer
2019-12-31 15:50       ` Siddhesh Poyarekar [this message]
2019-12-31 16:04         ` Florian Weimer
2019-12-31 16:11           ` Siddhesh Poyarekar
2019-12-31 17:43             ` Florian Weimer
2019-12-31 20:51               ` Florian Weimer
2020-01-02  5:55               ` Siddhesh Poyarekar
2020-01-02  9:22                 ` Florian Weimer
2019-12-17 14:30 ` [PATCH 2/5] Linux: Use system call tables during build Florian Weimer
2019-12-28 12:39   ` Siddhesh Poyarekar
2019-12-17 14:30 ` [PATCH 3/5] build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild Florian Weimer
2019-12-28 12:39   ` Siddhesh Poyarekar
2019-12-17 14:31 ` [PATCH 4/5] build-many-glibcs.py: Introduce glibc build policy classes Florian Weimer
2019-12-28 12:39   ` Siddhesh Poyarekar
2019-12-17 14:31 ` [PATCH 5/5] build-many-glibcs.py: Implement update-syscalls command Florian Weimer
2019-12-28 12:39   ` Siddhesh Poyarekar
2020-01-01 10:35 ` [PATCH 0/5] Implement built-in system call tables Florian Weimer

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=0b6f5557-e67f-b92f-269d-163c8df2d3c8@gotplt.org \
    --to=siddhesh@gotplt.org \
    --cc=fw@deneb.enyo.de \
    --cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).