I’m having trouble getting pthread_equal() to match stored pthreads. The pthread_t I get from pthread_self() seems to be truncated by 4 bytes compared to the one I get from pthread_create(). Comparisons are in the last code block! As a result, an attempt to loop through the stored pthreads and compare w…
Tag: linux
MPI program does nothing – running on linux
I’ve written this MPI C program on linux. The master is supposed to send tasks to the slaves and receive data from the slaves (and if there’re more tasks to give them to the finished slaves). After all the tasks are completed, it’s supposed to print a solution. It prints nothing and I can…
Unbound workqueue’s kthreads CPU affinity
Is there a way to set CPU affinity for unbound workqueue’s kthreads (those that named kthread/uXX:y)? Something like cpu mask for regular workqueues. Is it a good idea to set it for each kthread using taskset? Answer Workqueue subsystem exports sysfs attribute for setting cpu affinity for unbound worker…
sed removes one string in one file
I’m trying to remove one string in one file by using: But I’ve got the following error: What is it missing and why? Thanks! Answer /example/ is an address which tells sed where to run commands – on a line containing the string example. You didn’t specify any commands. This is a commnan…
How to find the FQDN of an Azure VM
I just spun up a new Azure VM from the portal. I want to find the FQDN of the said portal so that I can connect to it via SSH, using this scheme: ssh username@FQDN -p 22 Can anyone tell me where to look? I’ve spent many hours trying to do this, but to no avail. Answer For you to
Flex and Bison: Lexical analysis stops before end of input
I am using Flex and Bison to parse a simplified SQL grammar. I am running into an issue where Flex will stop tokenizing before the end of the file. When I pass the test case containing just: create database this; everything works fine and the tokens CREATE, DATEABASE, and ID are created. But when I pass a tes…
Why can’t stdout from calling c library printf in asm be piped to other programs?
I have written a simple NASM program: printtest.asm I am linking and creating an executable with the following commands: When linked and executed, this prints “val = 5” to the console no problem. As far as I’m aware, calling printf by default writes on stdout. So why when I try and pipe this…
Compiling simple C++ projects using make [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 7 years ago. Improve this ques…
Installing Perl DBI in SUN Solaries
I am trying to install perl DBI on SUN solaries 11 but I always got the following error: I did the following steps: Downloaded and extracted DBI-1.628 then in the shell command: Answer This means it cannot find a compiler on your machine. You should add the path to the compiler to your PATH variable. gcc and …
Duplicate MySQL Database in Linux CLI without Exporting an SQL File
I have a MySQL database which I want to duplicate using the Ubuntu Linux CLI without first having to download a MySQL file. I tried the following command: mysql -uroot -e’mysqldump -uroot db_old | mysql -uroot backup db_new;’ But got this error: ERROR 1064 (42000) at line 1: You have an error in y…