dual boot with Windows 10 off an DVD
sudo apt-get install gcc
gcc hw.c, ./a.out, sudo cat foo
sudo pm-hibernate
python3 hw.py
#!/usr/bin/python3
import os
fout=os.open("foo2",os.O_WRONLY|os.O_CREAT,0o644)
os.write(fout,bytes("hello Python on Lunux","utf-8"))
os.close(fout)
qt creator IDE c or C++ project but buggy for include and intellisense
gcc -H hw.c show all header files
eclipse C/C++ IDE (Mars) preference Editor/Adance check proposal will
assit intellisence, use ctrl-space to get O_WRONLY
eclipse install new software menu-> http://pydev.org/updates will install Python IDE.
note that Ubuntu has Phython 3 installed
Linux Concurrency intervening
int main()
{
int i,j=0;
if(fork())
while(i++<100) printf("parent %d\n ",getpid());
else
while(j++<100) printf("child %d\n",getpid());
}
Linux Concurrency synchronize by signal
header files stdio.h, stdlib.h
must include string.h for strsignal or segmentation fault for strsignal(WTERMSIG(status))
int main()
{
int status;
if(fork())
{
wait(&status);
if(WIFEXITED(status))
printf("exit status %d\n ",WEXITSTATUS(status));
if(WIFSIGNALED(status))
printf("signal status %d: %s\n",WTERMSIG(status),strsignal(WTERMSIG(status)));
}
else
{
*(int*)0=99; // segmentation fault
exit(3);
}
}
Pipe:
mkfifo /tmp/jqd
ls -l /tmp
cat /tmp/jqd (blocking) until another terminal date> /tmp/jqd
Saturday, February 20, 2016
First Landing on Ubuntu with Linux gcc and native command
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment