When using io_uring_queue_init it calls io_uring_setup. There’s an ENOMEM returned when there is insufficient amount of locked memory available for the process. A strace will look something like: What is the formula for how much locked memory is required per entry (first argument)? and if possible, based on the sq_entries/cq_entries in the params structure? Kernel code for the particularly keen.
Tag: io
Read a file that’s constantly updated (C++)
Let me start with saying that I’m around 3 days old in C++. Ok to the main question, I have a file that spans multiple lines, and I’m trying to print one specific line repeatedly, which is subject to change arbitrarily by some other process. Example file : I’m trying to print the middle line (one that starts with somevar).
getcwd() vs get_current_dir_name()?
Is it better to use getcwd(NULL, 0) or get_current_dir_name() ? What is common practice ? My uninformed guess is that a call to getcwd(NULL, 0) may be a better idea since it is possible that the PWD variable is not set… Answer Is it better to use getcwd(NULL, 0) or get_current_dir_name() ? What is common practice ? This is operating
Linux API: is it possible to specify `O_SYNC` option for a single `write` syscall
Such flags as O_DIRECT, O_SYNC, O_DSYNC can be used to specify synchronous / asynchronous IO at the time when descriptor is created (create syscall). But is it possible to use this flags for distinct write (or similar) syscalls in order to make some of them synchronous? Answer is it possible to use this flags for distinct write (or similar) syscalls
Piping to File Utility
I am being sent the bytes of thousands files over an interface, and my app must maintain statistics regarding the counts of various files types which it observes (text, HTML, binary, compressed, etc.). I have been using the subprocess module to run the file utility. However, as the scale has increased, I am having performance issues due to the IO
file descriptor unable to read 1 byte
I’m a beginner in Unix/Linux, just a question on file descriptor, my textbooks asks a question: In most Unix systems, typing ctrl-d indicates EOF on standard input. What happens if you type ctrl-d to the program in Figure 12.6(just a program that use select()) to while it is blocked in the call to select? and the answer is : a
can FileOutputStream.flush() guarantee that other processes can read the file content consistently?
I have a java process A that calls FileOutputStream.flush() to flush the content, and have another process B to read the file content. In most cases, the process B reads the content fine. However, sometimes B reports getting incorrect content. My question is, if the writer process crashes right after calling FileOutputStream.flush() before calling FileOutputStream.close(), can the java runtime guarantee
C Linux Pipe Reading Out-of-Order. Missing, and Duplicated Output
I am working on an application that needs to launch arbitrary child processes and read their output while they are running. It might be useful to think of it as a terminal emulator because it has to be able to run child processes many times throughout it’s lifetime and read back their output, and I want it to read back
How can I write a I/O bound C program?
I must write programs that are I/O Bound and that will make my I/O scheduler work like never done before for a Operating Systems homework, but I have no idea how to do it. I’ve tried writing a simple C program that counts the lines of big text files, but it executes too fast and I can’t measure the effectiveness
linux read sys call doesnt get EOF
First of all sorry if my English won’t be fluent and clear. I’m working on understanding pipes and communication between processes. I have tried to implement two c programs, the one writes into a certain pipe from what he reads from the standard input and the other one waits until the pipe opens and reads from it and prints to