Questions tagged [select-syscall]

7 questions
43
votes
3 answers

Why is select used in Linux

I was going through a serial program and I observed that they use select() before using read(). Why exactly is this required. Why cant we just directly call read() and check if it fails or not ? Also why do we have to increment the file descriptor…
user1667307
  • 2,041
  • 6
  • 27
  • 32
3
votes
1 answer

What does 'left' field of strace select mean?

I'm using strace to investigate the select system call of a process and I'm trying to figure out what does left mean. Find below the debug line extracted from the strace log. select(13, [6 7 8 11 12], [], NULL, {0, 10000}) = 1 (in [11], **left** {0,…
Alexandru Rusu
  • 569
  • 1
  • 5
  • 21
3
votes
0 answers

Is it appropriate to put blocking (without O_NONBLOCK) file desciptors to select/poll in Linux?

man select BUGS Under Linux, select() may report a socket file descriptor as "ready for reading", while nevertheless a subsequent read blocks. This could for example happen when data has arrived but upon examination has wrong checksum and…
Vi.
  • 37,014
  • 18
  • 93
  • 148
1
vote
1 answer

How to correctly use in sys/select.h

When using the timer in the following code, either the "Error calling select" error appears, otherwise new data is expected: timeval tv; tv.tv_sec = 1; tv.tv_usec = 0; if( select(s + 1, &readmask, NULL, NULL, &tv ) <= 0 ) { …
shaman888
  • 283
  • 1
  • 10
0
votes
1 answer

assembly mips use the function blt

where is my mistake? I need to print all the number that are bigger than zero and divided by 4. it says: (1).zip line 32: Runtime exception at 0x0040000c: address out of range 0x00000000 thanks a alot num1: .word -8 , num3 num2: .word 1998 ,…
0
votes
2 answers

Can i use select to send data on multiple interfaces as fast as the interface can process

I am an experienced network programmer and am faced with a situation where i need some advice. I am required to distribute some data on several outgoing interfaces (via different tcp socket connections, each corresponding to each interface).…
fkl
  • 5,412
  • 4
  • 28
  • 68
-2
votes
1 answer

Capturing syscalls of malicious python packages

I want to capture syscalls of malicious python packages. Is there any way to do this? Or can I capture syscalls in wireshark? For reference: Typosquatted Python packages, much like StackOverlow copy/paste.
Awaiz Khan
  • 29
  • 3