UNIX/Linux Programming - November 2009

Binary Process Tree using fork
 
Hello everyone, I am trying create a 4-level binary process tree using fork(). This means one parent process spawns 2 children, which spawn 4 grandchildren (...
[1 reply] : Write #include <unistd.h> #include <stdio.h> #include <sys/types.h... (by melkiy)
by vRltwE
File name with whitespace: Can not read!
 
Hi, I am using the code: string f = m.getfilename(); cout << "Arquivo: " << f << " "; iFile.open(f.c_str()); if (!iFile) { // file could...
[3 replies] Last: I guess getfilename() is not returning the filename u expect (by tene)
problem with compiler ..!
 
hi guys i have problem with compiler in linux .. when i test my program file .. i get this message :( Unable to exec g++.real: No such file or directo...
[4 replies] Last: Does your compiler support g++? In Linux version you can use g++. If... (by tene)
OpenGL Library on Linux
 
On Linux, is the whole GLX library always exported statically? For example, if I use glXQueryVersion and the result is that GLX 1.4 is supported, does it mean I...
[no replies]
makefile
 
hi i have to make this makefile and im really not sure with this extra cpp file in it, here they are. (using CC compiler), thanks! class1.cpp class2.cpp ...
[1 reply] : Pleas don't double post: http://www.cplusplus.com/forum/general/16778/ (by Bazzy)
by MaLi
dhcp client
 
Hi, On linux platform, I want to have dhcp client. port any open source client to my app (which seems to be a bit time consuming)? or communicate with the ...
[1 reply] : I think using the ISC dhcp (https://www.isc.org/software/dhcp) would b... (by sunilkeshava)
client socket
 
I have a client socket program written in c++ ,connecting to local ip:9102 if (connect(fd,(struct sockaddr *)&addr, (socklen_t)sizeof(struct sockaddr)) == -...
[no replies]
by CD4
something abt time()
 
#include <time.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> int main() { int i; time_t the_time; for(i = 1; i <= 10; i...
[4 replies] Last: thanks bazzy... :) (by CD4)
indirectly lost and definitely lost memory leak
 
Can someone please point to me where is the momory leak in the below code. thread.h: // includes... 9 struct DataStruct 10 { 11 int v1; 12 ...
[2 replies] Last: Oh yeah! Thanks I removed lines 7, 24, 40 Works fine now.. (by zheavensky)
Beginner C/C++ compiler
 
Hey guys just setup a fedora linux system as a virtual machine looking to get a decent beginner preferrably freeware if possible c/c++ compiler. Supposedly fedo...
[12 replies] Last: I'm guessing you really want something like KDevelop, not gcc. (by PanGalactic)
by CD4
Dirent.h
 
#include<stdio.h> #include<sys/types.h> #include<dirent.h> #include<string.h> struct dirent *drnt; int main() { DIR *dr; dr=opendir("/usr"); drnt=rea...
[10 replies] Last: #include<stdio.h> #include<sys/types.h> #include<sys/stat.h> #incl... (by chenzhizhong)
mktime issue
 
Hi, I'm trying to use the mktime function. In order to test I thought I'd try and get it to return time 0 i.e. 01/01/1970 00:00:00. The code I'm using is a...
[5 replies] Last: -3600 on gcc on FreeBSD amd64. Interestingly enough, going the othe... (by kbw)
unexpected behaviour of for loop?
 
hi thank you for your comments.
[3 replies] Last: Aside from that ridiculousness: # define N 36 # define SIZE pow... (by Disch)
Signal handling
 
How can I register a signal handler for all handle-able signals (i.e. everything except for SIGKILL and SIGSTOP)? Will I have to go signal(SIGx, signalhandler...
[2 replies] Last: Totally forgot about this topic. Thanks! I'll try that later. (by chrisname)
by CD4
playing with enviornment variables..
 
#include<stdlib.h> #include<stdio.h> #include<string.h> char *envstrn; int main( int argc,char *argv ) { if(argc==2) { envstrn=getenv(argv ); ...
[5 replies] Last: echo itself is a program which takes care of all these things, your pr... (by writetonsharma)
by CD4
argument passing
 
#include<unistd.h> #include<stdio.h> int main(int argc,char *argv ) { int opt=0; extern int optind,opterr,optop; while (opt=getopt(argc,argv,":hw:ra")...
[2 replies] Last: ok.. die to this the problem was occouring.. thanks for helping me :... (by CD4)
by omronz
print out client IP which has been connected to the server
 
Hai I have successfully write a socket code where data can be sent to/from a client/server host using c++. However, I would like to add a function where the ...
[1 reply] : For a connection-oriented socket see man getpeername (by jsmith)
pthread_mutex_call blocks forever causing cpu usage 100%
 
pthread_mutex_lock() call never returns causing other threads to wait for gaining its lock forever in turn causing 100% cpu load. I have tried using alterna...
[1 reply] : code please. I have seen this, you probably need to restart the system... (by writetonsharma)
sending and receive data thru ip address
 
Hi, i am currently doing a project which require me to send a data to another system in the network(wifi). The system that receive the data will do task base on...
[2 replies] Last: ok thanks. (by jiaqing)
by quant
segfault if I call func from a lib, why?
 
hi every1, perhaps some one be able to help me in that worst deal... actually I use libiptc & libxtables from netfilter project and have got this trace.... i...
[4 replies] Last: closed, I made it without xtables lib ;) (by quant)
November 2009 Pages: 12
  Archived months: [oct2009] [dec2009]

This is an archived page. To post a new message, go to the current page.