Skip to content

Tag: c++

What does the output of this program means?

I am trying to get the maximum virtual memory of the current process in Linux. And I am using getrlimit() I get -1 in both values. Shouldn’t I expect the virtual memory max allowed for the current process ? Answer The value RLIM_INFINITY denotes no limit on a resource (both in the structure returned by …

linux – serial port programming ( ASCII to Byte )

I tried to receive data from serial port. However, those data is unrecognized to me. The root cause is because those are in ASCII. To decode the data, it needs to be the byte formate. The buffer I’ve created is unsigned char [255] and I try to print out the data by using Two questions here: The data mig…

Detect if a remote computer is Windows or Linux OS

I have IP Address and Server name of a remote computer. I am able to query WMI to get the OS version if the computer is running Windows but is there a way i can query the remote computer and get the OS version if the computer is not running Windows (Linux, Solaris)? Answer I guess Active Directory is going

fgets return less characters

I’m writing an assembly program for practice. The assembly program uses the c library functions. I’m concern in particular with fgets() function. The fgets manual page states: I have declared a buffer of 1024 bytes and used it in the fgets funtion to read text from a file. But the program is retur…