Skip to content

Tag: c++

shm_open and ftruncate() in Shared Memory Programming

I want to create a Shared Memory Object and truncate it to a specific size. SHMSIZE is defined with 512 MODE is set with S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP | S_IWOTH | S_IROTH Here is my Code While Debugging i watched that the return value of shm_open() is 0 every time, but i can see this object in

the physical address of global descriptor table?

I’m reading the disassemble code of mit os’s kernel code. I think the kernel code should follow the same rule. I saw the instruction in the kernel that load the Global Descriptor Table is as follows: lgdtl 0x10f018 I know the lgdt takes the length of the GDT (16bit) and the address of the GDT (32b…

How to create virtual CAN port on linux? (C++)

I want to create program that would emulate CAN port for testing purposes for another big application. Program should send previously recorded data through this virtual CAN. Anyone has any experience with such thing? I’m thinking to establish virtual COM, and send through it data packed in CAN Frames. C…

debugging c using heap memory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 9 years ago. Improve this question I am working with heap memory and I wrote an example below: I execu…

Nonblocking Get Character

Platform: Linux 3.2.0 x86 (Debian 7) Compiler: GCC 4.7.2 (Debian 4.7.2-5) I am writing a function that reads a single character from stdin if a character is already present in stdin. If stdin is empty the function is suppose to do nothing and return -1. I googled nonblocking input and was pointed to poll() or…