Questions tagged [file-descriptor]
Generally, a file descriptor is an index for an entry in a kernel-resident data structure containing the details of all open files. In POSIX this data structure is called a file descriptor table, and each process has its own file descriptor table. In Microsoft Windows terminology and in the context of the C standard I/O library, "file handle" is preferred.
file-descriptor
1,461
questions
0
votes
2
answers
70
views
How can I force a call to read(2) to return EINVAL?
Context
I'm writing code that emulates one aspect of pidfds on platforms that don't support them (old Linux, other Unix).
I'm doing this a) in order to test some pidfd-related code on very old ...
0
votes
0
answers
8
views
Android PdfRenderer from RAM data in insolatedProcess service
I'm trying to run the PdfRenderer in a Service with isoletedProcess=true.
The problem is with ParcelFileDescriptor. I have tried:
to create a tmp file File.createTmpFile (No access to file system)
to ...
1
vote
2
answers
69
views
Are additional changes necessary for worker_rlimit_nofile to take effect?
We have an Ubuntu server with Nginx.
ulimit -n returns 1024 and in /etc/nginx/nginx.conf there are the following settings:
user www-data;
worker_processes auto;
events {
worker_connections 1024;
}...
1
vote
1
answer
65
views
File descriptor handling during Fork syscall
I am new to the world of POSIX and I'm trying to understand how fork syscall works in C, especially how it copies file descriptors and buffers across parent to child. Specifically these two cases:
...
0
votes
0
answers
41
views
Restoring stdin after dup2 without using fflush is inconsistent
I am trying to understand how duping works in c. I tried to save the file descriptor to stdin so it can be recovered then used dup2 to use file in.txt as input and then use dup2 to return stdin to its ...
-1
votes
1
answer
26
views
CSV File cannot creat: Bad File Descriptor
Failure: OSError: [Errno 9] Bad file descriptor
Python can not find the path!!
import pandas as pd
import csv
def read_csv_auto_header(file_path):
# Öffnen der CSV-Datei und Lesen der Daten mit ...
0
votes
1
answer
62
views
Poll for data written to a file descriptor
Suppose we have a file descriptor for a TCP socket. Is there a way to poll for data written to a socket (as opposed to data being available for reading, or the socket being available for writing)? i.e....
1
vote
0
answers
69
views
How can a zombie process hold resources?
Wikipedia states the following on zombie processes:
However, zombies can also hold buffers open, consuming memory. Zombies can hold handles to file descriptors, which prevents the space for those ...
0
votes
2
answers
488
views
AWS Lambda: IOException: Too many open files
I deployed an AWS Lambda written in C#, and depending on the input I can see in the console the following error message (truncated):
{
"Cause": "{\n \"errorType\": \"...
1
vote
2
answers
171
views
C: anonymous file (created with memfd_create(2)) is always being written according to select(2)
I have a set of file descriptors that I am "watching" with select.
All of the other file descriptors are sockets; I want to introduce a new file descriptor so that I can "event driven&...
1
vote
1
answer
58
views
initializing buttons on beaglebone black
I have code to initialize GPIO and read the button state value from a file descriptor. I only have 3 buttons.The code is very simple. first I initialize 3 gpio and configure them to output. then I ...
1
vote
0
answers
41
views
Is a mqd_t of a POSIX-MQ a critical resource?
I need to send messages through same Posix-MQ in multiple threads.
These threads all act as a "producer" of messages, while the "consumer" is another process.
Should I do mq_open ...
0
votes
0
answers
47
views
Poll on BPF device descriptor
In my macOS (Sonoma 14.3) program, I'm hand-crafting a packet filter instead of using libpcap:
int
create_filter(const char *device, struct bpf_insn *instructions, unsigned int num_instructions) {
...
0
votes
0
answers
116
views
Does Open file descriptors on windows incur a performance cost
I am building a high performance application that streams data in from ~1000 different sources of on disk data (aka files) on demand on windows.
To minimize latency, I was looking into keeping all ...
1
vote
2
answers
37
views
How to apply the linux 'file' command to the output (STDOUT) of a program to determine its file type
I want to determine the file-type of the contents of the STDOUT output of a program (without first saving the output to a file)
i.e., notionally, I would like to run: myprogram | file
However, `/usr/...