GithubHelp home page GithubHelp logo

grb2015 / linux_c Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 272 KB

Understanding UNIX/LINUX Programming--A Guide to Theory and Practice <<Unix-Linux编程实践教程>> 该项目是对本书的学习。

Shell 0.47% C 99.53% HTML 0.01%
c linux

linux_c's People

Contributors

grb2015 avatar

Stargazers

 avatar  avatar

Forkers

wangweitl81

linux_c's Issues

[8da31] [13_dgsend.c] UDP send error

[root@grb_host 13_UDP_license]# hostname

  •  grb_host
    
  •  [root@grb_host 13_UDP_license]# ./dgsend grb_host 12345 aaa
    
  •  make addr: Resource temporarily unavailable
    
  •  [root@grb_host 13_UDP_license]#
    
  •  bug: make addr: Resource temporarily unavailable
    

run exception (运行错误)

when execute ./pwd print:
error looking for inum 1
运行错误:执行不正确,error looking for inum 1

fix print format (修改输出格式)

'ls' current ouput are:
drwxrwxrwx 1 root root 0 Apr 1 14:36 .
drwxrwxrwx 1 root root 0 Mar 31 11:10 ..
-rwxrwxrwx 1 root root 9860 Apr 1 14:36 ls
-rwxrwxrwx 1 root root 5279 Apr 1 14:36 ls.c

[df56227] smsh1执行第一个命令后,发生错误

[root@localhost shell3]# ./sh1

ls -l
total 37
-rwxrwxrwx. 1 root root 792 Apr 27 22:12 execute.c
-rwxrwxrwx. 1 root root 10173 Apr 27 22:47 sh1
-rwxrwxrwx. 1 root root 10173 Apr 27 22:51 sh3
-rwxrwxrwx. 1 root root 1082 Apr 27 22:36 smsh1.c
-rwxrwxrwx. 1 root root 327 Apr 27 22:43 smsh.h
-rwxrwxrwx. 1 root root 3717 Apr 27 22:46 splitline.c
drwxrwxrwx. 1 root root 0 Apr 25 20:32 sriptdemo
Segmentation fault (core dumped)
[root@localhost shell3]#

linux_c-practice's issue

issue1: [ 8_thread]1_create.c bug: 并没有打印出print_id,线程1没有被启动啊 #2
|* gcc 1_create.c -o 1 -lpthread
[root@grb_host 8_thread]# ./1
~ |* main thead id = 2078766848
~ |* [root@grb_host 8_thread]#
~ |*
~ |* bug: 并没有打印出print_id,线程1没有被启动啊

issue2:[10_IPC/4_NamedPipe server.c client.c] open(FIFO_WRITE,O_WRONLY)有问题 #3

通过gdb调试,发现
server.c 程序在wfd = open(FIFO_WRITE,O_WRONLY);会阻塞不动了。
client.c 程序在 if( (wfd = open(FIFO_WRITE,O_WRONLY)) == -1)会阻塞不动了。

issue3:[7_process] 1_fork.c 父进程先于子进程结束后,为什么子进程无法退出shell #1

bug :如果注释掉sleep(1),为什么子进程无法退出?(在我的计算机上调度是父进程先退出)
[root@grb_host 7_process]# ./1
I am parent process,mychild pid = 3368,mypid = 3367,myppid =3314
exit
[root@grb_host 7_process]# I am child process,mypid = 3368,myppid =1
exit

[d1b15a][UDP_license version1] run time error

  1. server
    grb-sim@xxx:~/github/LINUX_CMD/13_UDP_license/lisence_version1$ ./3_lisence_server1
  2. client
    grb-sim@xxx:~/github/LINUX_CMD/13_UDP_license/lisence_version1$ ./3_lisence_client1
  3. server
    SERVER: GOT: HELO 31536 Segmentation fault (core dumped)
    grb-sim@xxx:~/github/LINUX_CMD/13_UDP_license/lisence_version1$

server got Segmentation fault (core dumped) when client was connecting.

ctime run error

when the program rum to ctime , error occures.

程序编译后,当运行到printf( "%.12s ", 4+ctime(&info_p->st_mtime));后,发生错误。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.