From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) by sourceware.org (Postfix) with ESMTPS id 8A5873858D38 for ; Tue, 21 Jul 2020 06:08:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8A5873858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=brian.inglis@systematicsw.ab.ca Received: from [192.168.1.104] ([24.64.172.44]) by shaw.ca with ESMTP id xlRcjLswb62brxlRdjSF4R; Tue, 21 Jul 2020 00:08:05 -0600 X-Authority-Analysis: v=2.3 cv=LKf9vKe9 c=1 sm=1 tr=0 a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17 a=IkcTkHD0fZMA:10 a=B6KMzFptAAAA:20 a=CCpqsmhAAAAA:8 a=w_pzkKWiAAAA:8 a=7rWo4p0M_kAXpZf26XcA:9 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 a=sRI3_1zDfAgwuvI8zelB:22 Reply-To: newlib@sourceware.org Subject: Re: POSIX XXXat() methods To: newlib@sourceware.org References: From: Brian Inglis Autocrypt: addr=Brian.Inglis@SystematicSw.ab.ca; prefer-encrypt=mutual; keydata= mDMEXopx8xYJKwYBBAHaRw8BAQdAnCK0qv/xwUCCZQoA9BHRYpstERrspfT0NkUWQVuoePa0 LkJyaWFuIEluZ2xpcyA8QnJpYW4uSW5nbGlzQFN5c3RlbWF0aWNTdy5hYi5jYT6IlgQTFggA PhYhBMM5/lbU970GBS2bZB62lxu92I8YBQJeinHzAhsDBQkJZgGABQsJCAcCBhUKCQgLAgQW AgMBAh4BAheAAAoJEB62lxu92I8Y0ioBAI8xrggNxziAVmr+Xm6nnyjoujMqWcq3oEhlYGAO WacZAQDFtdDx2koSVSoOmfaOyRTbIWSf9/Cjai29060fsmdsDLg4BF6KcfMSCisGAQQBl1UB BQEBB0Awv8kHI2PaEgViDqzbnoe8B9KMHoBZLS92HdC7ZPh8HQMBCAeIfgQYFggAJhYhBMM5 /lbU970GBS2bZB62lxu92I8YBQJeinHzAhsMBQkJZgGAAAoJEB62lxu92I8YZwUBAJw/74rF IyaSsGI7ewCdCy88Lce/kdwX7zGwid+f8NZ3AQC/ezTFFi5obXnyMxZJN464nPXiggtT9gN5 RSyTY8X+AQ== Organization: Systematic Software Message-ID: <9bbf1ebe-35c3-b3f8-b70b-18e262f84ea4@SystematicSw.ab.ca> Date: Tue, 21 Jul 2020 00:08:03 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfEZa+7SxAKNNPgkx1r3z/TFyl+NHPWVoololPZz3nNTn34Wmg6s2ONARjIvsQS5+Yd7rqA5VzQ8I+I8CNZBhNjVrXAb8KpCx6B5/RFw4ebtB0jGuJgPA ZHsSP3dWCoQ2rhhyaf5WX480rJzDDr9GhRYyJT0/eUIMU28Po+NymRusQAGu0as1eDdnv9WdvQirTQ== X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_LOTSOFHASH, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 06:08:08 -0000 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.]