public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* POSIX XXXat() methods
@ 2020-07-20 22:33 Joel Sherrill
  2020-07-21  5:00 ` Sebastian Huber
  2020-07-21  6:08 ` Brian Inglis
  0 siblings, 2 replies; 4+ messages in thread
From: Joel Sherrill @ 2020-07-20 22:33 UTC (permalink / raw)
  To: Newlib, Eshan Dhawan

Hi

Eshan has been looking for generic implementations of the 15 POSIX methods
like openat(), mkdirat(), etc. He has searched the normal places I know of
and hasn't found implementations of most of them that don't just call a
dedicated system call. Here is his analysis.

https://docs.google.com/spreadsheets/d/1nEniQOs9TxDy5fb7P0_XFg7VknQDldG1BDFWSoqdKg0/edit?usp=sharing

It appears that many could be implemented generically but with possible
overhead of saving current working directory, changing, returning, etc. and
likely race conditions.

Does anyone have any ideas on where to get generic implementations to port?
Or implementation strategies to write OS agnostic versions?

Thanks.

--joel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: POSIX XXXat() methods
  2020-07-20 22:33 POSIX XXXat() methods Joel Sherrill
@ 2020-07-21  5:00 ` Sebastian Huber
  2020-07-21  5:03   ` Sebastian Huber
  2020-07-21  6:08 ` Brian Inglis
  1 sibling, 1 reply; 4+ messages in thread
From: Sebastian Huber @ 2020-07-21  5:00 UTC (permalink / raw)
  To: joel, Newlib, Eshan Dhawan

On 21/07/2020 00:33, Joel Sherrill wrote:

> Eshan has been looking for generic implementations of the 15 POSIX methods
> like openat(), mkdirat(), etc. He has searched the normal places I know of
> and hasn't found implementations of most of them that don't just call a
> dedicated system call. Here is his analysis.
>
> https://docs.google.com/spreadsheets/d/1nEniQOs9TxDy5fb7P0_XFg7VknQDldG1BDFWSoqdKg0/edit?usp=sharing
FreeBSD supports all of the mentioned functions. I am not sure why there 
are "No" in the FreeBSD column.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: POSIX XXXat() methods
  2020-07-21  5:00 ` Sebastian Huber
@ 2020-07-21  5:03   ` Sebastian Huber
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Huber @ 2020-07-21  5:03 UTC (permalink / raw)
  To: joel, Newlib, Eshan Dhawan


On 21/07/2020 07:00, Sebastian Huber wrote:
> On 21/07/2020 00:33, Joel Sherrill wrote:
>
>> Eshan has been looking for generic implementations of the 15 POSIX 
>> methods
>> like openat(), mkdirat(), etc. He has searched the normal places I 
>> know of
>> and hasn't found implementations of most of them that don't just call a
>> dedicated system call. Here is his analysis.
>>
>> https://docs.google.com/spreadsheets/d/1nEniQOs9TxDy5fb7P0_XFg7VknQDldG1BDFWSoqdKg0/edit?usp=sharing 
>>
> FreeBSD supports all of the mentioned functions. I am not sure why 
> there are "No" in the FreeBSD column.
Sorry, scandirat() is not supported, but this is a GNU extension and not 
a POSIX function.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: POSIX XXXat() methods
  2020-07-20 22:33 POSIX XXXat() methods Joel Sherrill
  2020-07-21  5:00 ` Sebastian Huber
@ 2020-07-21  6:08 ` Brian Inglis
  1 sibling, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2020-07-21  6:08 UTC (permalink / raw)
  To: newlib

On 2020-07-20 16:33, Joel Sherrill wrote:
> Eshan has been looking for generic implementations of the 15 POSIX methods
> like openat(), mkdirat(), etc. He has searched the normal places I know of
> and hasn't found implementations of most of them that don't just call a
> dedicated system call. Here is his analysis.
> 
> https://docs.google.com/spreadsheets/d/1nEniQOs9TxDy5fb7P0_XFg7VknQDldG1BDFWSoqdKg0/edit?usp=sharing
> 
> It appears that many could be implemented generically but with possible
> overhead of saving current working directory, changing, returning, etc. and
> likely race conditions.
> 
> Does anyone have any ideas on where to get generic implementations to port?
> Or implementation strategies to write OS agnostic versions?

Would those used by Cygwin in the other half of your favourite repo qualify,
although AFAIK they are under LGPL3+ with a section 4 Combined Works Linking
Exception and section 5 Combined Libraries allows choice of terms with conditions:

https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=winsup/CYGWIN_LICENSE
https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=winsup/COPYING.LIB

Add openat, faccessat, fchmodat, fchownat, fstatat,
futimesat, linkat, mkdirat, mkfifoat, mknodat, readlinkat, renameat,
symlinkat, unlinkat to list of implemented Solaris functions.

https://sourceware.org/git/?p=newlib-cygwin.git;a=blobdiff;f=winsup/cygwin/syscalls.cc;h=1a2572186c320c15275f458a8dad7623e09d40b7;hp=28533a58b961e2e379a6bda3904e7ecfa072cf75;hb=c57b57e5c43ab112e50d5e214b8cef61f8027946;hpb=ca48eb65e9f332484b1fe00ae373a1121091cbfb

and check around that time and search the logs for others; POSIX compat xref in:

https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=winsup/doc/posix.xml;h=8e88245acc0f6e1de10c8fecd81be6e1529dd0a2;hb=HEAD


readable:

https://cygwin.com/cygwin-api/

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-21  6:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 22:33 POSIX XXXat() methods Joel Sherrill
2020-07-21  5:00 ` Sebastian Huber
2020-07-21  5:03   ` Sebastian Huber
2020-07-21  6:08 ` Brian Inglis

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).