Does Linux provide a system call which can create a "view" of a limited byte range of a backing file? I'm envisioning something that for example would act on an open file descriptor and either modify it or generate a new file descriptor where file offsets are relative to the beginning of the range and end at the end of the range.
The use-case would be to limit a non-cooperating subprocess to accessing only a particular portion of an input file.
splice()
system call seems like it would be nearly right for the stream case. – llasram Feb 27 '19 at 20:26mmap()
call comes to mind, as long as the subprocess is spawned from the process that does the mapping... – twalberg Feb 27 '19 at 21:20