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
Tag: c++
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 (32bit) as the operand. However,
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. Could it work? And how could I establish virtual COM on
How can I link to an older version of a shared library
I’m building my program on my computer, on which libtiff.so -> libtiff.so.5. And then pushing the builds on another machine on which libtiff.so -> libtiff.so.4. At runtime, my program exists : « error while loading shared libraries: libtiff.so.5: cannot open shared object file: No such file or directory ». I cannot upgrade the other machine, and I would like to
error: aggregate value used where an integer was expected
I am having following union and I have a function When i compile this code it is giving following error Answer You are failing to access a field of the indexed union array: mydata[0] is a value of type union data, and can’t be cast to uint64_t. You need to access the proper union member: to select the uint64_t value.
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 execute is as : ./heap test and the
missing lboost_thread-mt in mongodb cpp driver (ubuntu server x64)
i have a brand new ubuntu server x64. i installed the following packages build-essential libboost-all-dev mongodb-dev mongodb-10gen now when i try to compile the example code i get this error. root@server:/home/user/Desktop# g++ mongotest.cpp -pthread -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options -lboost_system -o tutorial /usr/bin/ld: cannot find -lboost_thread-mt collect2: error: ld returned 1 exit status i searched everywhere i can think of and
How to view the list of c library functions in Linux? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 6 years ago. Improve this question I’m a newbie in Linux programming. I found that the way
gcc won’t compile SDL C Program (undefined reference to SDL functions)
I recently moved to linux and i’m having an issue with compiling SDL C programs using gcc. The command i’m using: Even by seperating sdl-config flags: I’m getting the same error: My very simple program: Answer Order of arguments to gcc matters a lot. Read about Invoking GCC (and documentation of binutils, which gcc uses). Then replace with Better yet,
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 select(). First I tried to