Linux, C. Below issue only happens by using epoll(). If I use select() on server socket, there is no data loss. ============================= Update: I received errno =11 (Try again) in read(). Do I need to continue, or break the while loop? ============================= I have client side, send 1280 K data in 10 times (each time, I send 128K data); I
Tag: c++
there is any way to open and read a file over a SSH connection?
I have an access to some server where there is a lot of data. I can’t copy the whole of data on my computer. I can’t compile on the server the program I want because the server doesn’t have all libs I need. I don’t think that the server admin would be very happy to see me coming and asking
What is the epoch of CLOCK_TAI?
Since Linux kernel version 3.10, the function clock_gettime() now accept CLOCK_TAI. I didn’t manage to find a detailed description of this clock. What is its epoch ? EDIT 1: Just compared the output of CLOCK_REALTIME and CLOCK_TAI on my Linux 3.19 OS and it returns the exact same value (1442582497) !? Is CLOCK_REALTIME decremented at leap seconds ? EDIT 2:
linux C sending data from child to parent is fine, but fail to send data from child to parent
I would like to fork a child and connect pipes to the stdin and stdout of child. And then run the exec ./xx. After that I send 17 from parent to child and child print it. all good so far. but when I send a 17 return to parent it doesnt work. The result is : output nothing and look
WIFSTOPPED is not working properly
I am trying to implement the fg command in my mini shell. The problem is as follows: A process(gedit) is started in foreground. I stop with ctrl+z and check exit my wait loop by checking the return value of WIFSTOPPED(status): I want this to resume when fg command is given: But WIFSTOPPED keeps returning non zero so waitpid is breaking
C – Linux Kernel – Assistance with current_uid()
I have been working on part of an assignment which I am having trouble fixing. The requirement was to intercept the system call open and to replace it with a new system open call only for regular users and would print out the user id and filename in the system log. Otherwise it would just execute the standard system open
Understanding the msghdr structure from sys/socket.h
I’m trying to understand the following members of the msghdr structure of the sys/socket.h lib. struct iovec *msg_iov scatter/gather array void *msg_control ancillary data, see below It states below: Ancillary data consists of a sequence of pairs, each consisting of a cmsghdr structure followed by a data array. The data array contains the ancillary data message, and the cmsghdr structure
Signal and output in c
Some time ago I found this exercise in C: without changing the main function, so that receiving a SIGUSR1 signal output is directed and added to a file in append mode as the first parameter. At the reception of another SIGUSR1 the output is directed to the console, and so on. How do such an exercise? Answer I’ll give you
How to send image data over linux socket
I have a relatively simple web server I have written in C++. It works fine for serving text/html pages, but the way it is written it seems unable to send binary data and I really need to be able to send images. I have been searching and searching but can’t find an answer specific to this question which is written
How to get number of packets received, Average round trip time from ping command if I use popen
I have to ping the given IP address and I need to print the below values in C++. It is fine to use popen and get the output. If I use popen, I will get a file pointer and I need to read on this file pointer to get the whole output and I have to extract the values using