linux

NPTL caps maximum threads at 65528?

The following code is supposed to make 100,000 threads: /* compile with: gcc -lpthread -o thread-limit thread-limit.c */ /* originally from: http://www.volano.com/linuxnotes.html */ #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <pthread.h> #include <string.h> #define MAX_THREADS 100000 int i; void run(void) { ...

Linux: what are means of fields in /proc/net/dev?

The Linux file /proc/net/dev reads like this: [me@host ~]$ cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed What do fields drop and errs mean? Are some errs packets ...

identify user in a bash script called by sudo

Hello, If I create the script /root/bin/whoami.sh conatining: #!/bin/bash whoami And this script is called by a user with a properly configured sudo, it will indicate root Is there a fast way to obtain the actual user in a script, or will I have to resort to parameters passing along this username? TIA, Bert ...

In Imagemagick for linux how do I do a batch convert for a directory.

The title says it all but I want to be able to specify the location in both where to scan and where the converted file will go. It's just there is a lot of conversions and I've got a script which should sort it for me. Currently I've tried convert -resize 300x300 > /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/norm...

How to full expand variables in autoconf?

In this example: configure.ac: ... AC_CONFIG_FILES([script1]) AC_OUTPUT script1.in: #!/bin/bash ... config=@datadir@/blah This @datadir@ is expanded to ${prefix}/share, is there any way to expand it to /usr/local/share? ...

Difference between CLOCK_REALTIME and CLOCK_MONOTONIC?

Could you explain the difference between CLOCK_REALTIME and CLOCK_MONOTONIC clocks returned by clock_gettime() on Linux? Which is a better choice if I need to compute elapsed time between timestamps produced by an external source and the current time? Lastly, if I have an NTP daemon periodically adjusting system time, how do these adju...

How to get a content of a hidden file over https?

Now I am successfully using WebClient.DownloadString to get file content from ESX server. My URI is something like: https://&lt;ip&gt;/folder/&lt;file-path&gt;?dcPath=ha-datacenter&amp;dsName=&lt;datastore-name&gt; But how can I get a content of a hidden file (e.g. '.myfile')? UPDATE: I have the 404 or Not Found error message when I ...

ptrace'ing multithread application

Hello I have a "debugger"-like application, named hyper-ptrace. It starts user_appl3 which is multithreaded with NPTL. Main loop of hyper-ptrace is: wait3(&status, FLAGS, &u); // find a pid of child, which has a signal switch (signal = WSTOPSIG(status)) { case SIGTRAP: do_some_analysis_of_the_child(pid, &status) // up to several...

Windows NAmed Pipes alternative in Linux

Hi, We are porting existing windows code to Linux. We are using ACE as abstraction layer. We are using windows named pipes for communicating with multiple clients and to perform overlapped operations . What is the equivalent to this in linux. I have checked linux named pipes(FIFO), but they seem to support only one client and server an...

Linux: MySQL: how to use a mysql databases on a mounted NTFS as mysql database in linux?

hi, i wanna use databases in D:\xampp\mysql\data in my linux mysql without moving it. so i can work on them from both linux and windows here is what i did: # mount -t ntfs -o uid=mysql,gid=mysql,dmask=002,fmask=113 /dev/sda5 /media/public/ # cd /var/lib/mysql # ln /media/public/xampp/mysql/data/my_db -s # chown -R mysql:mysql /var/lib...

Is there any Visual C++ compiler for linux supporting most of VS Visual C++?

Is there any Visual C++ compiler for linux supporting most of VS Visual C++? If there is no such what is best alternative for porting\adapting your visual C++ code to? ...

IO multiplexing in Linux

Is there something like the sendfile-syscall that works with multiple target file descriptors (i.e. instead of copying from one FD to another FD, it could should copy to, say, 4 FDs)? I know that when talking about asynchronous IO, this is known as gather/scatter, but I could not find anything in the Linux AIO documentation. ...

real-time writes to disk

I have a thread that needs to write data from an in-memory buffer to a disk thousands of times. I have some requirements of how long each write takes because the buffer needs to be cleared for a separate thread to write to it again. I have tested the disk with dd. I'm not using any filesystem on it and writing directly to the disk (open...

How to stream media playing in songbird?

Songbird is an open source media player with lot of plugins. I want to broadcast media playing on my songbird over a network. Kindly, do not suggest me using another player. ...

PHP 5.3.2 and Zend Framework Sessions

We recently upgraded our PHP and apache versions on our server. Prior to this our sessions were able to be carried over between subdomains without error. Unfortunately when we made the upgrades it stopped working. From what I can see everything is the same. I have tried ini_set("suhosin.session.cryptdocroot", "Off"); ini_set("suhosi...

Linux - environment variables $HOME versus $(HOME)

Recently I had to update my JAVA environment variable in .bashrc echo $JAVA_HOME # prints out /usr/java/... echo $(JAVA_HOME) # raises error "can't find JAVA_HOME command" I'm worried that my make file, which uses $(JAVA_HOME) won't work since $JAVA_HOME gets recognized, but not $(JAVA_HOME) How can I get $(JAVA_HOME) to equ...

sending raw data through usb on linux

Hello, I'm printing some labels on a Zebra TLP-2844 printer, and been doing it fine on windows by sending the EPL instructions to the shared USB printer, as following: type Label.prn > \my-pc\zebra and it seems to work with serial ports to with type Label.prn > COM1 Now i'm trying to to the same on linux, but it's getting re...

vim indentation correction not working correctly

I'm using vim to edit files that use a programming language where the end of line is not marked with ;. This causes problems when I try to fix indentation in vim. If I put a ; at the end then vim is able to correctly fix the indentation, but since this programming language doesn't have a ; at the end of a statement the indentation isn't ...

how to make vim format source code correctly

I'm trying to use vim to edit source code for AutoHotkey. This is how the source code looks when correctly formatted: if foo { if bar = 1 callFunc1() if bar = 2 callFunc2() if bar = 3 callFunc3() } If I do =G, then this is what vim changes it to: if foo { if bar = 1 callFunc1() ...

A question about execv and process family relationship

After a process forks and the forked son invokes execv, is the result still the son of the father? ...