Skip to content

Tag: linux

Errors opening a file in c

currently I’m having problems with the function below trying to open a file, no matter what I give it the function can’t seem to open the file. I’m currently passing in “./input.txt” which is a file in the same directory as the executable. Is there anything blatantly wrong with t…

pthread_mutex_t in multiple processes…who destroys it?

I’m using a pthread_mutex_t to synchronize access to a resource between multiple processes which are on the same level (i.e. there isn’t a parent/child relationship). How can I determine when it’s safe to call pthread_mutex_destroy? The only way I can think of to determine if the mutex is in…

Who schedules threads?

I have a question about scheduling threads. on the one hand, I learned that threads are scheduled and treated as processes in Linux, meaning they get scheduled like any other process using the conventional methods. (for example, the Completely Fair Scheduler in linux) On the other hand, I also know that the C…

Using shell commands with boot2docker

I have created a boot2docker VirtualBox instance, I can SSH into it OK but then when I try and run any commands such as bash I get Pretty sure I’m missing something really simple but can’t see what. Looking in /bin it doesn’t look to contain bash I’m pretty new to the *nix world so be …

PostgreSQL CSV import from command line

I’ve been using the psql Postgres terminal to import CSV files into tables using the following which works fine except that I have to be logged into the psql terminal to run it. I would like to know if anyone knows of a way to do a command similar to this from the Linux shell command line similar to how

Unable to direct insert in mysql database from linux xshell

i have run below command to insert data into my mysql database. sql query is ok. but after run the query, a prompt is coming to enter the password. but in my database no password is set. SO if i press enter key without writing anything then it is inserting data. How can i avoid to this prompt. That means

Using bc as daemon in BASH shell from awk

In BASH environment I can communicate with bc program using fifo. But in awk I can write but no read with getline function. How can I read from “/dev/fd/4” in awk. My awk version is: mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan Thanks Laci Continued: I did some further experiment and I su…

Bulk message transfer USB Linux

I am at the very beginning to write my own Linux Driver for a dds generator. I want to write 2 bulk messgages to the generator when der Kernel call the probe function. But I dont know how to call the usb_bulk_msg function. I hope you could me. hsync Answer Kernel is kinda self-explanatory project, so usually …