Re: unlinkat

Jorge Almeida <[email protected]> Thu, 22 Dec 2011 20:24:32 +0000
Newsgroups gmane.linux.lib.dietlibc
Message-ID <CAKpSnpKeE_u34kWhkCXSCYZvQjWaDwkkJ7C_bb6B5d3ZuQ2-Fg@mail.gmail.com>
On Thu, Dec 22, 2011 at 8:01 PM, Felix von Leitner
<[email protected]> wrote:
>> I think dietlibc doesn't support unlinkat() and friends (unless it
>> requires headers other that fcntl.h). Can we have it? It would spare
>> chdir'ing or some strallocs just to keep paths.
>
> Does glibc have an emulation for ENOSYS?
> How would you even do that?
>
> Just adding those syscalls is trivial but since they are so new, I
> wonder what the benefit would be.  You could not rely on those syscalls
> being there, so you'd have to keep the extra state anyway.  Or am I
> missing something?
>
I have no experience whatsoever of programming on glibc, I only do dietlibc
stuff (in C, that is). I'm following the linux man pages, which is good enough
for me since I don't use any other OS. In other words, I'm not trying to write
portable stuff. I had no idea unlinkat was particularly new, nor linux-only (it
exists in my system,  up to date Arch linux). If so, I understand that you
might not want it in dietlibc. The benefit (I think) is smaller binaries: no
need to allocate a stralloc for the path of every file I want to delete;
alternatively, I can chdir to each directory and then chdir back to the
original dir, but what would be the overhead? unlinkat et al. just seems a good
idea...

Jorge