Skip to content

Tag: c++

Building C with automake under OS X and Linux

Currently I’m writing a RPC system for delay tolerant networks based on the Serval project from Australia (GitHub) in C. Mainly I’m developing on macOS El Capitan and everything works fine. But it is somewhat important that my code runs on macOS and Linux. But Linux makes trouble. I choose automak…

X11: XQueryPointer gives me fuzzy Windows

I am currently trying to find if one of my Windows is underneath the Mouse cursor. This is not done in my process that creates the window, but in another process. What I am currently doing is finding the Window via the process PID (and I made sure _NET_WM_PID is set correctly by my program). This basically wo…

Differing CPUID usage from high-level languages

I’m attempting to utilize an x86 ASM function that requires certain processor architecture. I understand that I need to check a specific bit after calling “CPUID standard function 01H”. Below is a C implementation from the CPUID Wikipedia page for calling CPUID: Though the Linux kernel uses …

Why does msgrcv returns ENOMSG

System V message queue is created successfully, command ipcs -q outputs: But the program to receive the message returns: exit: msgrcv error, No message of desired type This is my code: Answer Transferring comments to an answer. I suggested: Maybe there isn’t a message waiting? Where did you write the co…

Use of -g and -o options in gcc command in c programming

Suppose there are 2 c program named abc.c and xyz.c . Now we want to work with the 2 executables at a time. So we change the name of the ./a.out using Even gcc -o abc abc.c works. What does the -g and -o in the above commands specify or describe? What is the significance of -g and -o in

C Server/Client with Sockets

[Just 2 minor questions on the ground of this remaining] I try to write a simple server/client in C to send messages over sockets. It must run under Linux and Windows with MinGW. I found many examples for Linux but way to many arent working with Windows. It would be really nice if you would help me. For the s…

Compiling pintool with sqlite3 database

I am writing a pintool to instrument my binary. I would like to use sqlite3 database to store the information about instructions. I can compile and execute sqlite3 “helloworld” example without any problem. As well I can compile and execute my pintool without sqlite connection. However, whenever I …

Closing then opening standard input in C under Linux

I have a C console application under Linux (Raspbian – Raspberry Pi). The program has some character animation – it prints out messages character by character. For example, the text Please give me your name! is printed out completely after 5 seconds (char by char). Afterwards, the user is asked to…