├── Exercise ├── 13 │ ├── 13_5 │ ├── a.out │ ├── 13_4.c │ └── out.txt ├── 14 │ └── a.out ├── 15 │ └── a.out ├── 16 │ ├── 16_1 │ └── a.out ├── 17 │ ├── tfile │ └── a.out ├── 18 │ ├── 1 │ │ ├── a.out │ │ └── 18_1.c │ ├── 2 │ │ └── 18_2.c │ ├── 3 │ │ └── a.out │ ├── 4 │ │ └── a.out │ ├── 5 │ │ ├── 18_5 │ │ └── a.out │ ├── 7 │ │ ├── a │ │ │ ├── a │ │ │ └── b │ │ └── a.out │ └── 8 │ │ └── mynftw.o ├── 19 │ └── a.out ├── 23 │ └── 23_1.c ├── 34 │ ├── 2 │ │ ├── a.out │ │ ├── sleep │ │ └── sleep.c │ ├── 3 │ │ └── a.out │ ├── 4 │ │ ├── a.out │ │ └── log │ ├── 6 │ │ ├── a.out │ │ └── main.c │ └── 7 │ │ └── a.out ├── 35 │ ├── 1 │ │ └── a.out │ ├── 3 │ │ └── a.out │ └── 4 │ │ └── a.out ├── 37 │ └── a.out ├── 38 │ ├── 1 │ │ └── 38_1.sh │ └── 2 │ │ ├── 38_2 │ │ ├── exec │ │ ├── a.out │ │ └── exec.c ├── 39 │ └── a.out ├── 40 │ └── a.out ├── 41 │ ├── d_main │ ├── main.c │ ├── mod.o │ ├── s_main │ ├── libmod.a │ ├── mod.c │ └── libmod.so ├── 42 │ ├── a.out │ ├── mod.o │ ├── mod1.o │ ├── mod2.o │ ├── mod.c │ ├── libmod.so.1.0.1 │ ├── libmod1.so.1.0.1 │ ├── libmod2.so.1.0.1 │ ├── mod1.c │ └── mod2.c ├── 47 │ ├── a.out │ ├── b.out │ ├── c.out │ ├── 47_6 │ │ ├── a.out │ │ ├── test.o │ │ ├── binary_fifo.o │ │ ├── binary_fifo.h │ │ └── binary_sems.h │ ├── semun.h │ ├── 47_5 │ │ └── event_flag.h │ ├── 47_3b.c │ └── 47_4.h ├── 48 │ ├── a.out │ ├── 48_4 │ │ ├── a.out │ │ ├── creat_shm.c │ │ └── pr_shmid_ds.c │ └── 48_3 │ │ └── Makefile ├── 49 │ ├── a.out │ ├── 49_2 │ │ ├── r.out │ │ ├── w.out │ │ ├── a.txt │ │ └── b.txt │ ├── 49_3 │ │ └── a.out │ └── 49_4 │ │ └── a.out ├── 50 │ ├── a.out │ └── 2.c ├── 52 │ ├── 52_1 │ │ ├── a.out │ │ ├── w.out │ │ └── mq_write.c │ ├── 52_2 │ │ ├── c.out │ │ └── s.out │ ├── 52_5 │ │ ├── a.out │ │ ├── test.out │ │ └── test.c │ └── 52_6 │ │ ├── a.out │ │ ├── t.out │ │ └── test.c ├── 53 │ ├── 53_3 │ │ └── sv2px.c │ ├── 53_1 │ │ └── a.out │ ├── 53_2 │ │ ├── a.out │ │ ├── test.out │ │ └── test.c │ └── 53_4 │ │ ├── ex.out │ │ ├── px.out │ │ └── sv.out ├── 55 │ ├── 1 │ │ ├── file │ │ ├── libcurrtime.so │ │ ├── aout │ │ ├── bout │ │ ├── curr_time.o │ │ └── libcurrtime.so.1.0.1 │ ├── 3 │ │ ├── file │ │ ├── a │ │ ├── b │ │ └── b.c │ ├── 4 │ │ ├── file │ │ └── main │ ├── 5 │ │ ├── main │ │ └── sleep_lock │ ├── 6 │ │ ├── file │ │ ├── libcurrtime.so │ │ ├── try_fcntl │ │ └── while_fcntl │ ├── 8 │ │ ├── a │ │ ├── b │ │ ├── c │ │ ├── aout │ │ ├── bout │ │ └── cout │ └── 9 │ │ ├── mand │ │ ├── a │ │ ├── b │ │ ├── aout │ │ └── bout │ │ └── non_mand │ │ ├── a │ │ ├── b │ │ ├── aout │ │ └── bout ├── 57 │ ├── 0 │ │ ├── cl.out │ │ ├── sv.out │ │ ├── und.h │ │ └── cl.c │ ├── 1 │ │ ├── cl.out │ │ ├── sv.out │ │ ├── u.h │ │ └── cl.c │ ├── 2 │ │ ├── cl.out │ │ ├── sv.out │ │ └── myund.h │ ├── 3 │ │ ├── cl.out │ │ ├── sv.out │ │ └── myund.h │ └── 4 │ │ └── a.out ├── 59 │ ├── 1 │ │ ├── cl │ │ ├── cl.out │ │ ├── sv.out │ │ ├── myrlb.o │ │ ├── ind.h │ │ └── my_read_line_buf.h │ ├── 2 │ │ ├── cl.out │ │ ├── sv.out │ │ └── ind.h │ ├── 3 │ │ ├── cl.out │ │ ├── sv.out │ │ ├── myinet.o │ │ ├── in_xfr.h │ │ └── in_xfr_cl.c │ ├── 4 │ │ ├── kv.o │ │ ├── cl.out │ │ ├── sv.out │ │ └── header │ │ │ └── kv.h │ └── 5 │ │ ├── a.out │ │ └── b.out ├── 60 │ ├── 1 │ │ ├── cl.out │ │ └── sv.out │ └── 2 │ │ ├── cl.out │ │ └── echo_inetd_test.out ├── 61 │ ├── 2 │ │ └── a.out │ ├── 3 │ │ ├── outfile1 │ │ ├── infile │ │ ├── outfile2 │ │ └── a.out │ ├── 4 │ │ └── a.out │ ├── 5 │ │ ├── cl.out │ │ ├── sv.out │ │ ├── shell_cl │ │ ├── shell_h.h │ │ └── shell_h.c │ └── 6 │ │ ├── cl.out │ │ └── sv.out ├── 62 │ ├── 1 │ │ ├── a.out │ │ └── file │ ├── 2 │ │ ├── file │ │ ├── libmyttyname.so │ │ ├── main │ │ ├── myttyname.h │ │ ├── libmyttyname.so.1.0.1 │ │ └── main.c │ ├── 3 │ │ ├── file │ │ ├── libmygetpass.so │ │ ├── main │ │ ├── mygetpass.o │ │ ├── libmygetpass.so.1 │ │ ├── mygetpass.h │ │ └── main.c │ └── 4 │ │ └── a.out ├── 63 │ ├── 1 │ │ └── t_poll.out │ ├── 2 │ │ ├── echo_sv.out │ │ ├── echo_tcp_cl.out │ │ └── echo_unp_cl.out │ ├── 3 │ │ ├── cl.out │ │ └── sv.out │ ├── 5 │ │ └── sp.out │ ├── 7 │ │ └── demo.out │ └── 8 │ │ └── demo_sigio.out ├── 64 │ ├── 2 │ │ └── script.out │ ├── 3 │ │ └── script.out │ ├── 4 │ │ ├── replay │ │ ├── script_time.out │ │ └── script_replay.out │ ├── 5 │ │ ├── ssh_cl.out │ │ └── ssh_sv.out │ └── 7 │ │ └── unbuffer.out ├── 20_4.c ├── 23_1.c ├── 24_5.c ├── 27_2.c ├── 43_1.c ├── 46_1.c ├── 27_3.sh ├── 21_1 ├── 22_4 ├── 29_1 ├── 30_1 ├── 31_1 ├── 44_1 ├── 44_2 ├── a.out ├── script_exercise │ ├── input.txt │ ├── a.out │ ├── longest_line.awk │ └── exec_awk.c ├── 30_2 │ ├── test │ ├── test.o │ ├── tsb_tree.o │ ├── test.c │ └── Makefile ├── 31_2 │ ├── test │ ├── test.o │ ├── test_tls │ ├── tls_test.o │ ├── tls_dirname.o │ ├── ts_dirname.o │ └── ts_dirname.h ├── 54_1 │ ├── r.out │ └── w.out ├── 44_3456 │ ├── a.out │ ├── fifo_seqnum_client │ ├── fifo_seqnum_server │ ├── fifo_seqnum_client.o │ ├── fifo_seqnum_server.o │ └── Makefile ├── 46_1 │ ├── svmsg_send │ ├── svmsg_create │ ├── svmsg_receive │ └── Makefile ├── 33_1.c ├── 46_2 │ ├── msg_seqnum_client │ ├── msg_seqnum_client.o │ ├── msg_seqnum_server │ ├── msg_seqnum_server.o │ ├── Makefile │ └── msg_seqnum.h ├── 46_45 │ ├── svmsg_file_client │ ├── svmsg_file_server │ ├── svmsg_file_client.o │ ├── svmsg_file_server.o │ └── Makefile ├── 27_3.c ├── 8_1.c ├── 46_0.c ├── 46_6 │ └── Makefile ├── 24_3.c ├── 3_1.c ├── 45_1.c ├── 26_1.c ├── 8_2.c ├── 25_1.c ├── 20_2.c ├── 20_3b.c ├── 29_1.c ├── 20_3.c ├── 24_2.c ├── 44_?p743.c └── 44_7.c ├── tlpi-dist ├── lib │ ├── semun.h │ ├── pty_fork.c │ ├── pty_fork.h │ ├── rdwrn.c │ ├── rdwrn.h │ ├── signal.c │ ├── curr_time.c │ ├── curr_time.h │ ├── file_perms.c │ ├── file_perms.h │ ├── read_line.c │ ├── read_line.h │ ├── binary_sems.c │ ├── binary_sems.h │ ├── cap_functions.c │ ├── cap_functions.h │ ├── event_flags.c │ ├── event_flags.h │ ├── inet_sockets.c │ ├── inet_sockets.h │ ├── print_rlimit.c │ ├── print_rlimit.h │ ├── print_rusage.c │ ├── print_rusage.h │ ├── tty_functions.c │ ├── tty_functions.h │ ├── unix_sockets.c │ ├── unix_sockets.h │ ├── become_daemon.c │ ├── become_daemon.h │ ├── pty_master_open.c │ ├── pty_master_open.h │ ├── read_line_buf.h │ ├── region_locking.c │ ├── region_locking.h │ ├── scm_functions.c │ ├── scm_functions.h │ ├── create_pid_file.c │ ├── create_pid_file.h │ ├── signal_functions.c │ ├── signal_functions.h │ ├── ugid_functions.c │ ├── ugid_functions.h │ ├── itimerspec_from_str.c │ ├── itimerspec_from_str.h │ ├── print_wait_status.c │ ├── print_wait_status.h │ ├── userns_functions.c │ ├── userns_functions.h │ ├── get_num.o │ ├── libtlpi.a │ ├── rdwrn.o │ ├── signal.o │ ├── curr_time.o │ ├── pty_fork.o │ ├── read_line.o │ ├── binary_sems.o │ ├── event_flags.o │ ├── file_perms.o │ ├── inet_sockets.o │ ├── print_rlimit.o │ ├── print_rusage.o │ ├── unix_sockets.o │ ├── alt_functions.o │ ├── become_daemon.o │ ├── cap_functions.o │ ├── read_line_buf.o │ ├── region_locking.o │ ├── scm_functions.o │ ├── tty_functions.o │ ├── ugid_functions.o │ ├── create_pid_file.o │ ├── error_functions.o │ ├── print_wait_status.o │ ├── pty_master_open.o │ ├── signal_functions.o │ ├── userns_functions.o │ ├── itimerspec_from_str.o │ └── README ├── libtlpi.a ├── mmap │ ├── mmcat │ ├── mmcopy │ ├── t_mmap │ ├── anon_mmap │ ├── t_remap_file_pages │ └── Makefile ├── proc │ ├── necho │ ├── longjmp │ ├── t_getenv │ ├── modify_env │ ├── bad_longjmp │ ├── display_env │ ├── setjmp_vars │ └── Makefile ├── pty │ ├── script │ ├── unbuffer │ └── Makefile ├── acl │ ├── acl_view │ └── Makefile ├── cap │ ├── cap_text │ ├── cap_launcher │ ├── demo_file_caps │ ├── show_secbits │ ├── t_cap_get_file │ ├── t_cap_get_pid │ ├── t_cap_set_file │ └── check_password_caps ├── fileio │ ├── copy │ ├── seek_io │ ├── t_readv │ ├── large_file │ ├── t_truncate │ ├── atomic_append │ ├── bad_exclusive_open │ ├── multi_descriptors │ └── Makefile ├── files │ ├── chiflag │ ├── t_chown │ ├── t_stat │ ├── t_umask │ ├── t_utime │ ├── t_utimes │ └── Makefile ├── pgsjc │ ├── job_mon │ ├── t_setsid │ ├── catch_SIGHUP │ ├── disc_SIGHUP │ ├── handling_SIGTSTP │ ├── orphaned_pgrp_SIGHUP │ └── Makefile ├── signals │ ├── a.out │ ├── ouch │ ├── intquit │ ├── t_kill │ ├── sig_sender │ ├── t_sigqueue │ ├── catch_rtsigs │ ├── demo_SIGFPE │ ├── nonreentrant │ ├── sig_receiver │ ├── t_sigsuspend │ ├── nonreentrant.o │ ├── sigmask_longjmp │ ├── signalfd_sigval │ ├── t_sigaltstack │ ├── t_sigwaitinfo │ ├── ignore_pending_sig │ ├── sig_speed_sigsuspend │ ├── sigmask_siglongjmp │ └── sigmask_siglongjmp.o ├── svipc │ ├── t_ftok │ ├── svmsg_demo_server │ └── Makefile ├── time │ ├── strtime │ ├── show_time │ ├── calendar_time │ ├── process_time │ └── Makefile ├── tty │ ├── new_intr │ ├── no_echo │ ├── demo_SIGWINCH │ ├── test_tty_functions │ └── Makefile ├── vmem │ ├── memlock │ ├── t_mprotect │ ├── madvise_dontneed │ └── Makefile ├── altio │ ├── select_mq │ ├── self_pipe │ ├── t_select │ ├── demo_sigio │ ├── epoll_input │ ├── poll_pipes │ ├── epoll_flags_fork │ ├── multithread_epoll_wait │ ├── multithread_epoll_wait.o │ └── Makefile ├── filesys │ ├── t_mount │ ├── t_statfs │ ├── t_statvfs │ ├── t_umount │ └── Makefile ├── getopt │ ├── t_getopt │ └── Makefile ├── inotify │ ├── dnotify │ ├── rand_dtree │ ├── demo_inotify │ ├── inotify_dtree │ └── Makefile ├── pipes │ ├── pipe_sync │ ├── change_case │ ├── pipe_ls_wc │ ├── popen_glob │ ├── simple_pipe │ ├── fifo_seqnum_client │ ├── fifo_seqnum_server │ ├── fifo_seqnum_client.o │ ├── fifo_seqnum_server.o │ └── Makefile ├── pmsg │ ├── pmsg_send │ ├── mq_notify_sig │ ├── pmsg_create │ ├── pmsg_getattr │ ├── pmsg_receive │ ├── pmsg_unlink │ ├── mq_notify_thread │ ├── mq_notify_via_signal │ ├── mq_notify_via_thread │ ├── mq_notify_sigwaitinfo │ └── Makefile ├── proccred │ ├── idshow │ └── Makefile ├── procexec │ ├── orphan │ ├── t_fork │ ├── acct_on │ ├── acct_view │ ├── envargs │ ├── footprint │ ├── t_clone │ ├── t_execl │ ├── t_execle │ ├── t_execlp │ ├── t_execve │ ├── t_system │ ├── t_vfork │ ├── closeonexec │ ├── demo_clone │ ├── make_zombie │ ├── multi_wait │ ├── acct_v3_view │ ├── child_status │ ├── exit_handlers │ ├── fork_sig_sync │ ├── fork_stdio_buf │ ├── longest_line.awk │ ├── multi_SIGCHLD │ ├── pdeath_signal │ ├── vfork_fd_test │ ├── pdeath_signal.o │ ├── fork_file_sharing │ └── fork_whos_on_first ├── procres │ ├── rusage │ ├── rlimit_nproc │ ├── rusage_wait │ └── Makefile ├── psem │ ├── psem_post │ ├── psem_wait │ ├── psem_create │ ├── psem_getvalue │ ├── psem_trywait │ ├── psem_unlink │ ├── psem_timedwait │ ├── psem_timedwait.o │ └── thread_incr_psem ├── pshm │ ├── pshm_read │ ├── pshm_write │ ├── pshm_create │ ├── pshm_unlink │ └── Makefile ├── shlibs │ ├── dynload │ ├── dynload.o │ ├── version_scripts │ │ ├── sv_v1.map │ │ ├── vis.map │ │ ├── sv_v2.map │ │ └── sv_build.sh │ ├── Demo_no_lib.sh │ ├── Demo_static_lib.sh │ ├── Makefile │ └── demo_Bsymbolic │ │ └── Makefile ├── svmsg │ ├── svmsg_ls │ ├── svmsg_rm │ ├── svmsg_create │ ├── svmsg_info │ ├── svmsg_send │ ├── svmsg_chqbytes │ ├── svmsg_receive │ ├── svmsg_file_client │ ├── svmsg_file_server │ ├── svmsg_file_client.o │ ├── svmsg_file_server.o │ └── Makefile ├── svsem │ ├── svsem_mon │ ├── svsem_op │ ├── svsem_rm │ ├── svsem_create │ ├── svsem_demo │ ├── svsem_info │ ├── svsem_setall │ ├── event_flags.o │ └── Makefile ├── svshm │ ├── svshm_mon │ ├── svshm_rm │ ├── svshm_attach │ ├── svshm_create │ ├── svshm_info │ ├── svshm_lock │ ├── svshm_unlock │ ├── svshm_xfr_reader │ ├── svshm_xfr_writer │ ├── svshm_xfr_reader.o │ ├── svshm_xfr_writer.o │ └── Makefile ├── sysinfo │ ├── t_uname │ ├── procfs_pidmax │ ├── procfs_user_exe │ └── Makefile ├── daemons │ ├── t_syslog │ ├── daemon_SIGHUP │ ├── test_become_daemon │ └── Makefile ├── filebuff │ ├── mix23io │ ├── direct_read │ ├── write_bytes │ ├── mix23_linebuff │ ├── write_bytes_fsync │ ├── write_bytes_o_sync │ └── write_bytes_fdatasync ├── filelock │ ├── t_flock │ ├── i_fcntl_locking │ └── Makefile ├── procpri │ ├── sched_set │ ├── sched_view │ ├── demo_sched_fifo │ ├── t_setpriority │ ├── t_sched_getaffinity │ ├── t_sched_setaffinity │ └── Makefile ├── sockets │ ├── id_echo_cl │ ├── id_echo_sv │ ├── is_echo_cl │ ├── is_echo_sv │ ├── socknames │ ├── us_xfr_cl │ ├── us_xfr_sv │ ├── i6d_ucase_cl │ ├── i6d_ucase_sv │ ├── id_echo_cl.o │ ├── id_echo_sv.o │ ├── is_seqnum_cl │ ├── is_seqnum_sv │ ├── ud_ucase_cl │ ├── ud_ucase_sv │ ├── us_xfr_cl.o │ ├── us_xfr_sv.o │ ├── us_xfr_v2_cl │ ├── us_xfr_v2_sv │ ├── i6d_ucase_cl.o │ ├── i6d_ucase_sv.o │ ├── is_echo_v2_sv │ ├── is_seqnum_cl.o │ ├── is_seqnum_sv.o │ ├── is_seqnum_v2_cl │ ├── is_seqnum_v2_sv │ ├── scm_cred_recv │ ├── scm_cred_recv.o │ ├── scm_cred_send │ ├── scm_cred_send.o │ ├── scm_multi_recv │ ├── scm_multi_send │ ├── scm_rights_recv │ ├── scm_rights_send │ ├── t_gethostbyname │ ├── t_getservbyname │ ├── ud_ucase_cl.o │ ├── ud_ucase_sv.o │ ├── us_xfr_v2_cl.o │ ├── us_xfr_v2_sv.o │ ├── is_echo_inetd_sv │ ├── is_seqnum_v2_cl.o │ ├── is_seqnum_v2_sv.o │ ├── scm_multi_recv.o │ ├── scm_multi_send.o │ ├── scm_rights_recv.o │ ├── scm_rights_send.o │ ├── us_abstract_bind │ └── list_host_addresses ├── syslim │ ├── t_fpathconf │ ├── t_sysconf │ └── Makefile ├── timers │ ├── clock_times │ ├── cpu_burner │ ├── real_timer │ ├── t_nanosleep │ ├── timed_read │ ├── demo_timerfd │ ├── ptmr_null_evp │ ├── cpu_multi_burner │ ├── ptmr_sigev_signal │ ├── ptmr_sigev_thread │ ├── t_clock_nanosleep │ └── cpu_multithread_burner ├── xattr │ ├── t_setxattr │ ├── xattr_view │ └── Makefile ├── dirs_links │ ├── t_unlink │ ├── bad_symlink │ ├── list_files │ ├── view_symlink │ ├── nftw_dir_tree │ ├── t_dirbasename │ ├── file_type_stats │ ├── list_files_readdir_r │ └── Makefile ├── loginacct │ ├── dump_utmpx │ ├── utmpx_login │ ├── view_lastlog │ └── Makefile ├── threads │ ├── prod_condvar │ ├── thread_incr │ ├── detached_attrib │ ├── one_time_init │ ├── prod_no_condvar │ ├── simple_thread │ ├── thread_cancel │ ├── thread_cleanup │ ├── thread_incr_mutex │ ├── thread_lock_speed │ ├── thread_multijoin │ ├── pthread_barrier_demo │ ├── thread_incr_rwlock │ └── thread_incr_spinlock ├── memalloc │ ├── free_and_sbrk │ └── Makefile ├── progconc │ ├── syscall_speed │ └── Makefile ├── users_groups │ ├── t_getpwent │ ├── t_getpwnam_r │ ├── check_password │ ├── check_password.o │ └── Makefile ├── vdso │ ├── vdso_gettimeofday │ ├── syscall_gettimeofday │ └── Makefile ├── Makefile.inc.MacOSX ├── Makefile.inc.FreeBSD ├── cgroups │ └── Makefile ├── Makefile.inc.Tru64 ├── Makefile.inc.Solaris └── Makefile.inc.HP-UX ├── IMG ├── 1.png ├── 10.png ├── 11.png ├── 12.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png ├── 9.png ├── 13_1a.png ├── 13_1b.png ├── 13_4.png ├── 14_1a.png ├── 14_1b.png ├── 15_1a.png ├── 15_1b.png ├── 15_4.png ├── 34_2.png ├── 34_3.png ├── 35_3.png ├── 35_4.png ├── 38_1.png ├── 38_2.png ├── 39_1.png ├── 41_1.png ├── 55_1a.png ├── 55_2.png ├── 55_5.png ├── 55_8.png ├── 55_9a.png ├── 55_9b.png └── 63_7.png └── alias_commit /Exercise/17/tfile: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/18/7/a/a: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/18/7/a/b: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /Exercise/20_4.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/23_1.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/24_5.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/27_2.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/43_1.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/46_1.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/1/file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/3/file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/4/file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/6/file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/8/a: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/8/b: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/8/c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/62/2/file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/9/mand/a: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /Exercise/55/9/mand/b: -------------------------------------------------------------------------------- 1 | b -------------------------------------------------------------------------------- /Exercise/53/53_3/sv2px.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Exercise/55/9/non_mand/a: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /Exercise/55/9/non_mand/b: -------------------------------------------------------------------------------- 1 | b -------------------------------------------------------------------------------- /Exercise/61/3/outfile1: -------------------------------------------------------------------------------- 1 | 11 -------------------------------------------------------------------------------- /Exercise/62/3/file: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /tlpi-dist/lib/semun.h: -------------------------------------------------------------------------------- 1 | ../svsem/semun.h -------------------------------------------------------------------------------- /tlpi-dist/lib/pty_fork.c: -------------------------------------------------------------------------------- 1 | ../pty/pty_fork.c -------------------------------------------------------------------------------- /tlpi-dist/lib/pty_fork.h: -------------------------------------------------------------------------------- 1 | ../pty/pty_fork.h -------------------------------------------------------------------------------- /tlpi-dist/lib/rdwrn.c: -------------------------------------------------------------------------------- 1 | ../sockets/rdwrn.c -------------------------------------------------------------------------------- /tlpi-dist/lib/rdwrn.h: -------------------------------------------------------------------------------- 1 | ../sockets/rdwrn.h -------------------------------------------------------------------------------- /tlpi-dist/lib/signal.c: -------------------------------------------------------------------------------- 1 | ../signals/signal.c -------------------------------------------------------------------------------- /Exercise/27_3.sh: -------------------------------------------------------------------------------- 1 | #! /bin/cat -n 2 | Hello wrold -------------------------------------------------------------------------------- /Exercise/55/1/libcurrtime.so: -------------------------------------------------------------------------------- 1 | libcurrtime.so.1.0.1 -------------------------------------------------------------------------------- /Exercise/62/3/libmygetpass.so: -------------------------------------------------------------------------------- 1 | libmygetpass.so.1 -------------------------------------------------------------------------------- /tlpi-dist/lib/curr_time.c: -------------------------------------------------------------------------------- 1 | ../time/curr_time.c -------------------------------------------------------------------------------- /tlpi-dist/lib/curr_time.h: -------------------------------------------------------------------------------- 1 | ../time/curr_time.h -------------------------------------------------------------------------------- /tlpi-dist/lib/file_perms.c: -------------------------------------------------------------------------------- 1 | ../files/file_perms.c -------------------------------------------------------------------------------- /tlpi-dist/lib/file_perms.h: -------------------------------------------------------------------------------- 1 | ../files/file_perms.h -------------------------------------------------------------------------------- /tlpi-dist/lib/read_line.c: -------------------------------------------------------------------------------- 1 | ../sockets/read_line.c -------------------------------------------------------------------------------- /tlpi-dist/lib/read_line.h: -------------------------------------------------------------------------------- 1 | ../sockets/read_line.h -------------------------------------------------------------------------------- /Exercise/62/2/libmyttyname.so: -------------------------------------------------------------------------------- 1 | libmyttyname.so.1.0.1 -------------------------------------------------------------------------------- /tlpi-dist/lib/binary_sems.c: -------------------------------------------------------------------------------- 1 | ../svsem/binary_sems.c -------------------------------------------------------------------------------- /tlpi-dist/lib/binary_sems.h: -------------------------------------------------------------------------------- 1 | ../svsem/binary_sems.h -------------------------------------------------------------------------------- /tlpi-dist/lib/cap_functions.c: -------------------------------------------------------------------------------- 1 | ../cap/cap_functions.c -------------------------------------------------------------------------------- /tlpi-dist/lib/cap_functions.h: -------------------------------------------------------------------------------- 1 | ../cap/cap_functions.h -------------------------------------------------------------------------------- /tlpi-dist/lib/event_flags.c: -------------------------------------------------------------------------------- 1 | ../svsem/event_flags.c -------------------------------------------------------------------------------- /tlpi-dist/lib/event_flags.h: -------------------------------------------------------------------------------- 1 | ../svsem/event_flags.h -------------------------------------------------------------------------------- /tlpi-dist/lib/inet_sockets.c: -------------------------------------------------------------------------------- 1 | ../sockets/inet_sockets.c -------------------------------------------------------------------------------- /tlpi-dist/lib/inet_sockets.h: -------------------------------------------------------------------------------- 1 | ../sockets/inet_sockets.h -------------------------------------------------------------------------------- /tlpi-dist/lib/print_rlimit.c: -------------------------------------------------------------------------------- 1 | ../procres/print_rlimit.c -------------------------------------------------------------------------------- /tlpi-dist/lib/print_rlimit.h: -------------------------------------------------------------------------------- 1 | ../procres/print_rlimit.h -------------------------------------------------------------------------------- /tlpi-dist/lib/print_rusage.c: -------------------------------------------------------------------------------- 1 | ../procres/print_rusage.c -------------------------------------------------------------------------------- /tlpi-dist/lib/print_rusage.h: -------------------------------------------------------------------------------- 1 | ../procres/print_rusage.h -------------------------------------------------------------------------------- /tlpi-dist/lib/tty_functions.c: -------------------------------------------------------------------------------- 1 | ../tty/tty_functions.c -------------------------------------------------------------------------------- /tlpi-dist/lib/tty_functions.h: -------------------------------------------------------------------------------- 1 | ../tty/tty_functions.h -------------------------------------------------------------------------------- /tlpi-dist/lib/unix_sockets.c: -------------------------------------------------------------------------------- 1 | ../sockets/unix_sockets.c -------------------------------------------------------------------------------- /tlpi-dist/lib/unix_sockets.h: -------------------------------------------------------------------------------- 1 | ../sockets/unix_sockets.h -------------------------------------------------------------------------------- /tlpi-dist/lib/become_daemon.c: -------------------------------------------------------------------------------- 1 | ../daemons/become_daemon.c -------------------------------------------------------------------------------- /tlpi-dist/lib/become_daemon.h: -------------------------------------------------------------------------------- 1 | ../daemons/become_daemon.h -------------------------------------------------------------------------------- /tlpi-dist/lib/pty_master_open.c: -------------------------------------------------------------------------------- 1 | ../pty/pty_master_open.c -------------------------------------------------------------------------------- /tlpi-dist/lib/pty_master_open.h: -------------------------------------------------------------------------------- 1 | ../pty/pty_master_open.h -------------------------------------------------------------------------------- /tlpi-dist/lib/read_line_buf.h: -------------------------------------------------------------------------------- 1 | ../sockets/read_line_buf.h -------------------------------------------------------------------------------- /tlpi-dist/lib/region_locking.c: -------------------------------------------------------------------------------- 1 | ../filelock/region_locking.c -------------------------------------------------------------------------------- /tlpi-dist/lib/region_locking.h: -------------------------------------------------------------------------------- 1 | ../filelock/region_locking.h -------------------------------------------------------------------------------- /tlpi-dist/lib/scm_functions.c: -------------------------------------------------------------------------------- 1 | ../sockets/scm_functions.c -------------------------------------------------------------------------------- /tlpi-dist/lib/scm_functions.h: -------------------------------------------------------------------------------- 1 | ../sockets/scm_functions.h -------------------------------------------------------------------------------- /tlpi-dist/lib/create_pid_file.c: -------------------------------------------------------------------------------- 1 | ../filelock/create_pid_file.c -------------------------------------------------------------------------------- /tlpi-dist/lib/create_pid_file.h: -------------------------------------------------------------------------------- 1 | ../filelock/create_pid_file.h -------------------------------------------------------------------------------- /tlpi-dist/lib/signal_functions.c: -------------------------------------------------------------------------------- 1 | ../signals/signal_functions.c -------------------------------------------------------------------------------- /tlpi-dist/lib/signal_functions.h: -------------------------------------------------------------------------------- 1 | ../signals/signal_functions.h -------------------------------------------------------------------------------- /tlpi-dist/lib/ugid_functions.c: -------------------------------------------------------------------------------- 1 | ../users_groups/ugid_functions.c -------------------------------------------------------------------------------- /tlpi-dist/lib/ugid_functions.h: -------------------------------------------------------------------------------- 1 | ../users_groups/ugid_functions.h -------------------------------------------------------------------------------- /tlpi-dist/lib/itimerspec_from_str.c: -------------------------------------------------------------------------------- 1 | ../timers/itimerspec_from_str.c -------------------------------------------------------------------------------- /tlpi-dist/lib/itimerspec_from_str.h: -------------------------------------------------------------------------------- 1 | ../timers/itimerspec_from_str.h -------------------------------------------------------------------------------- /tlpi-dist/lib/print_wait_status.c: -------------------------------------------------------------------------------- 1 | ../procexec/print_wait_status.c -------------------------------------------------------------------------------- /tlpi-dist/lib/print_wait_status.h: -------------------------------------------------------------------------------- 1 | ../procexec/print_wait_status.h -------------------------------------------------------------------------------- /tlpi-dist/lib/userns_functions.c: -------------------------------------------------------------------------------- 1 | ../namespaces/userns_functions.c -------------------------------------------------------------------------------- /tlpi-dist/lib/userns_functions.h: -------------------------------------------------------------------------------- 1 | ../namespaces/userns_functions.h -------------------------------------------------------------------------------- /Exercise/64/4/replay: -------------------------------------------------------------------------------- 1 | 1498547 ls 2 | 4894068 echo aaa 3 | 6718013 echo bb 4 | -------------------------------------------------------------------------------- /IMG/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/1.png -------------------------------------------------------------------------------- /IMG/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/10.png -------------------------------------------------------------------------------- /IMG/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/11.png -------------------------------------------------------------------------------- /IMG/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/12.png -------------------------------------------------------------------------------- /IMG/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/2.png -------------------------------------------------------------------------------- /IMG/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/3.png -------------------------------------------------------------------------------- /IMG/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/4.png -------------------------------------------------------------------------------- /IMG/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/5.png -------------------------------------------------------------------------------- /IMG/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/6.png -------------------------------------------------------------------------------- /IMG/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/7.png -------------------------------------------------------------------------------- /IMG/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/8.png -------------------------------------------------------------------------------- /IMG/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/9.png -------------------------------------------------------------------------------- /Exercise/21_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/21_1 -------------------------------------------------------------------------------- /Exercise/22_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/22_4 -------------------------------------------------------------------------------- /Exercise/29_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/29_1 -------------------------------------------------------------------------------- /Exercise/30_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/30_1 -------------------------------------------------------------------------------- /Exercise/31_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/31_1 -------------------------------------------------------------------------------- /Exercise/44_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/44_1 -------------------------------------------------------------------------------- /Exercise/44_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/44_2 -------------------------------------------------------------------------------- /Exercise/61/3/infile: -------------------------------------------------------------------------------- 1 | 00112233aaaaaaaaaabbbbbbbbbbbbbbb 2 | ccccccccccccccccccccccccc -------------------------------------------------------------------------------- /Exercise/61/3/outfile2: -------------------------------------------------------------------------------- 1 | 2233aaaaaaaaaabbbbbbbbbbbbbbb 2 | ccccccccccccccccccccccccc -------------------------------------------------------------------------------- /IMG/13_1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/13_1a.png -------------------------------------------------------------------------------- /IMG/13_1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/13_1b.png -------------------------------------------------------------------------------- /IMG/13_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/13_4.png -------------------------------------------------------------------------------- /IMG/14_1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/14_1a.png -------------------------------------------------------------------------------- /IMG/14_1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/14_1b.png -------------------------------------------------------------------------------- /IMG/15_1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/15_1a.png -------------------------------------------------------------------------------- /IMG/15_1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/15_1b.png -------------------------------------------------------------------------------- /IMG/15_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/15_4.png -------------------------------------------------------------------------------- /IMG/34_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/34_2.png -------------------------------------------------------------------------------- /IMG/34_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/34_3.png -------------------------------------------------------------------------------- /IMG/35_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/35_3.png -------------------------------------------------------------------------------- /IMG/35_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/35_4.png -------------------------------------------------------------------------------- /IMG/38_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/38_1.png -------------------------------------------------------------------------------- /IMG/38_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/38_2.png -------------------------------------------------------------------------------- /IMG/39_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/39_1.png -------------------------------------------------------------------------------- /IMG/41_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/41_1.png -------------------------------------------------------------------------------- /IMG/55_1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/55_1a.png -------------------------------------------------------------------------------- /IMG/55_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/55_2.png -------------------------------------------------------------------------------- /IMG/55_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/55_5.png -------------------------------------------------------------------------------- /IMG/55_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/55_8.png -------------------------------------------------------------------------------- /IMG/55_9a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/55_9a.png -------------------------------------------------------------------------------- /IMG/55_9b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/55_9b.png -------------------------------------------------------------------------------- /IMG/63_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/IMG/63_7.png -------------------------------------------------------------------------------- /Exercise/55/3/a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/3/a -------------------------------------------------------------------------------- /Exercise/55/3/b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/3/b -------------------------------------------------------------------------------- /Exercise/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/a.out -------------------------------------------------------------------------------- /Exercise/script_exercise/input.txt: -------------------------------------------------------------------------------- 1 | a 2 | bb 3 | ccc 4 | dddd 5 | eee 6 | ff 7 | g 8 | -------------------------------------------------------------------------------- /alias_commit: -------------------------------------------------------------------------------- 1 | alias cmt='git add /home/water/work/TLPI_learn_note/;git commit -m "add"' -------------------------------------------------------------------------------- /Exercise/13/13_5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/13/13_5 -------------------------------------------------------------------------------- /Exercise/13/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/13/a.out -------------------------------------------------------------------------------- /Exercise/14/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/14/a.out -------------------------------------------------------------------------------- /Exercise/15/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/15/a.out -------------------------------------------------------------------------------- /Exercise/16/16_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/16/16_1 -------------------------------------------------------------------------------- /Exercise/16/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/16/a.out -------------------------------------------------------------------------------- /Exercise/17/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/17/a.out -------------------------------------------------------------------------------- /Exercise/18/5/18_5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/18/5/18_5 -------------------------------------------------------------------------------- /Exercise/19/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/19/a.out -------------------------------------------------------------------------------- /Exercise/30_2/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/30_2/test -------------------------------------------------------------------------------- /Exercise/31_2/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/31_2/test -------------------------------------------------------------------------------- /Exercise/37/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/37/a.out -------------------------------------------------------------------------------- /Exercise/38/2/38_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/38/2/38_2 -------------------------------------------------------------------------------- /Exercise/38/2/exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/38/2/exec -------------------------------------------------------------------------------- /Exercise/39/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/39/a.out -------------------------------------------------------------------------------- /Exercise/40/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/40/a.out -------------------------------------------------------------------------------- /Exercise/41/d_main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/41/d_main -------------------------------------------------------------------------------- /Exercise/41/main.c: -------------------------------------------------------------------------------- 1 | void mod(); 2 | 3 | int main() 4 | { 5 | mod(); 6 | 7 | return 0; 8 | } -------------------------------------------------------------------------------- /Exercise/41/mod.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/41/mod.o -------------------------------------------------------------------------------- /Exercise/41/s_main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/41/s_main -------------------------------------------------------------------------------- /Exercise/42/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/42/a.out -------------------------------------------------------------------------------- /Exercise/42/mod.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/42/mod.o -------------------------------------------------------------------------------- /Exercise/42/mod1.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/42/mod1.o -------------------------------------------------------------------------------- /Exercise/42/mod2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/42/mod2.o -------------------------------------------------------------------------------- /Exercise/47/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/47/a.out -------------------------------------------------------------------------------- /Exercise/47/b.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/47/b.out -------------------------------------------------------------------------------- /Exercise/47/c.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/47/c.out -------------------------------------------------------------------------------- /Exercise/48/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/48/a.out -------------------------------------------------------------------------------- /Exercise/49/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/49/a.out -------------------------------------------------------------------------------- /Exercise/50/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/50/a.out -------------------------------------------------------------------------------- /Exercise/55/1/aout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/1/aout -------------------------------------------------------------------------------- /Exercise/55/1/bout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/1/bout -------------------------------------------------------------------------------- /Exercise/55/4/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/4/main -------------------------------------------------------------------------------- /Exercise/55/5/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/5/main -------------------------------------------------------------------------------- /Exercise/55/8/aout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/8/aout -------------------------------------------------------------------------------- /Exercise/55/8/bout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/8/bout -------------------------------------------------------------------------------- /Exercise/55/8/cout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/8/cout -------------------------------------------------------------------------------- /Exercise/59/1/cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/1/cl -------------------------------------------------------------------------------- /Exercise/59/4/kv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/4/kv.o -------------------------------------------------------------------------------- /Exercise/62/2/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/62/2/main -------------------------------------------------------------------------------- /Exercise/62/3/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/62/3/main -------------------------------------------------------------------------------- /Exercise/18/1/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/18/1/a.out -------------------------------------------------------------------------------- /Exercise/18/3/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/18/3/a.out -------------------------------------------------------------------------------- /Exercise/18/4/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/18/4/a.out -------------------------------------------------------------------------------- /Exercise/18/5/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/18/5/a.out -------------------------------------------------------------------------------- /Exercise/18/7/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/18/7/a.out -------------------------------------------------------------------------------- /Exercise/30_2/test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/30_2/test.o -------------------------------------------------------------------------------- /Exercise/31_2/test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/31_2/test.o -------------------------------------------------------------------------------- /Exercise/34/2/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/34/2/a.out -------------------------------------------------------------------------------- /Exercise/34/2/sleep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/34/2/sleep -------------------------------------------------------------------------------- /Exercise/34/3/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/34/3/a.out -------------------------------------------------------------------------------- /Exercise/34/4/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/34/4/a.out -------------------------------------------------------------------------------- /Exercise/34/6/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/34/6/a.out -------------------------------------------------------------------------------- /Exercise/34/7/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/34/7/a.out -------------------------------------------------------------------------------- /Exercise/35/1/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/35/1/a.out -------------------------------------------------------------------------------- /Exercise/35/3/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/35/3/a.out -------------------------------------------------------------------------------- /Exercise/35/4/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/35/4/a.out -------------------------------------------------------------------------------- /Exercise/38/2/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/38/2/a.out -------------------------------------------------------------------------------- /Exercise/41/libmod.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/41/libmod.a -------------------------------------------------------------------------------- /Exercise/41/mod.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void mod() 4 | { 5 | printf("This is mod\n"); 6 | } -------------------------------------------------------------------------------- /Exercise/42/mod.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void mod() 4 | { 5 | printf("mod-function\n"); 6 | } -------------------------------------------------------------------------------- /Exercise/54_1/r.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/54_1/r.out -------------------------------------------------------------------------------- /Exercise/54_1/w.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/54_1/w.out -------------------------------------------------------------------------------- /Exercise/55/6/libcurrtime.so: -------------------------------------------------------------------------------- 1 | /home/water/work/TLPI_learn_note/Exercise/55/1/libcurrtime.so.1.0.1 -------------------------------------------------------------------------------- /Exercise/57/0/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/0/cl.out -------------------------------------------------------------------------------- /Exercise/57/0/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/0/sv.out -------------------------------------------------------------------------------- /Exercise/57/1/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/1/cl.out -------------------------------------------------------------------------------- /Exercise/57/1/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/1/sv.out -------------------------------------------------------------------------------- /Exercise/57/2/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/2/cl.out -------------------------------------------------------------------------------- /Exercise/57/2/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/2/sv.out -------------------------------------------------------------------------------- /Exercise/57/3/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/3/cl.out -------------------------------------------------------------------------------- /Exercise/57/3/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/3/sv.out -------------------------------------------------------------------------------- /Exercise/57/4/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/57/4/a.out -------------------------------------------------------------------------------- /Exercise/59/1/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/1/cl.out -------------------------------------------------------------------------------- /Exercise/59/1/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/1/sv.out -------------------------------------------------------------------------------- /Exercise/59/2/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/2/cl.out -------------------------------------------------------------------------------- /Exercise/59/2/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/2/sv.out -------------------------------------------------------------------------------- /Exercise/59/3/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/3/cl.out -------------------------------------------------------------------------------- /Exercise/59/3/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/3/sv.out -------------------------------------------------------------------------------- /Exercise/59/4/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/4/cl.out -------------------------------------------------------------------------------- /Exercise/59/4/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/4/sv.out -------------------------------------------------------------------------------- /Exercise/59/5/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/5/a.out -------------------------------------------------------------------------------- /Exercise/59/5/b.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/5/b.out -------------------------------------------------------------------------------- /Exercise/60/1/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/60/1/cl.out -------------------------------------------------------------------------------- /Exercise/60/1/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/60/1/sv.out -------------------------------------------------------------------------------- /Exercise/60/2/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/60/2/cl.out -------------------------------------------------------------------------------- /Exercise/61/2/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/61/2/a.out -------------------------------------------------------------------------------- /Exercise/61/3/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/61/3/a.out -------------------------------------------------------------------------------- /Exercise/61/4/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/61/4/a.out -------------------------------------------------------------------------------- /Exercise/61/5/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/61/5/cl.out -------------------------------------------------------------------------------- /Exercise/61/5/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/61/5/sv.out -------------------------------------------------------------------------------- /Exercise/61/6/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/61/6/cl.out -------------------------------------------------------------------------------- /Exercise/61/6/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/61/6/sv.out -------------------------------------------------------------------------------- /Exercise/62/1/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/62/1/a.out -------------------------------------------------------------------------------- /Exercise/62/4/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/62/4/a.out -------------------------------------------------------------------------------- /Exercise/63/3/cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/3/cl.out -------------------------------------------------------------------------------- /Exercise/63/3/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/3/sv.out -------------------------------------------------------------------------------- /Exercise/63/5/sp.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/5/sp.out -------------------------------------------------------------------------------- /tlpi-dist/libtlpi.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/libtlpi.a -------------------------------------------------------------------------------- /tlpi-dist/mmap/mmcat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/mmap/mmcat -------------------------------------------------------------------------------- /tlpi-dist/proc/necho: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/proc/necho -------------------------------------------------------------------------------- /tlpi-dist/pty/script: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pty/script -------------------------------------------------------------------------------- /Exercise/18/8/mynftw.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/18/8/mynftw.o -------------------------------------------------------------------------------- /Exercise/31_2/test_tls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/31_2/test_tls -------------------------------------------------------------------------------- /Exercise/41/libmod.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/41/libmod.so -------------------------------------------------------------------------------- /Exercise/44_3456/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/44_3456/a.out -------------------------------------------------------------------------------- /Exercise/47/47_6/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/47/47_6/a.out -------------------------------------------------------------------------------- /Exercise/47/47_6/test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/47/47_6/test.o -------------------------------------------------------------------------------- /Exercise/48/48_4/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/48/48_4/a.out -------------------------------------------------------------------------------- /Exercise/49/49_2/r.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/49/49_2/r.out -------------------------------------------------------------------------------- /Exercise/49/49_2/w.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/49/49_2/w.out -------------------------------------------------------------------------------- /Exercise/49/49_3/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/49/49_3/a.out -------------------------------------------------------------------------------- /Exercise/49/49_4/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/49/49_4/a.out -------------------------------------------------------------------------------- /Exercise/52/52_1/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/52/52_1/a.out -------------------------------------------------------------------------------- /Exercise/52/52_1/w.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/52/52_1/w.out -------------------------------------------------------------------------------- /Exercise/52/52_2/c.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/52/52_2/c.out -------------------------------------------------------------------------------- /Exercise/52/52_2/s.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/52/52_2/s.out -------------------------------------------------------------------------------- /Exercise/52/52_5/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/52/52_5/a.out -------------------------------------------------------------------------------- /Exercise/52/52_6/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/52/52_6/a.out -------------------------------------------------------------------------------- /Exercise/52/52_6/t.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/52/52_6/t.out -------------------------------------------------------------------------------- /Exercise/53/53_1/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/53/53_1/a.out -------------------------------------------------------------------------------- /Exercise/53/53_2/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/53/53_2/a.out -------------------------------------------------------------------------------- /Exercise/53/53_4/ex.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/53/53_4/ex.out -------------------------------------------------------------------------------- /Exercise/53/53_4/px.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/53/53_4/px.out -------------------------------------------------------------------------------- /Exercise/53/53_4/sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/53/53_4/sv.out -------------------------------------------------------------------------------- /Exercise/55/6/try_fcntl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/6/try_fcntl -------------------------------------------------------------------------------- /Exercise/55/9/mand/aout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/9/mand/aout -------------------------------------------------------------------------------- /Exercise/55/9/mand/bout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/9/mand/bout -------------------------------------------------------------------------------- /Exercise/59/1/myrlb.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/1/myrlb.o -------------------------------------------------------------------------------- /Exercise/59/3/myinet.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/59/3/myinet.o -------------------------------------------------------------------------------- /Exercise/61/5/shell_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/61/5/shell_cl -------------------------------------------------------------------------------- /Exercise/63/7/demo.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/7/demo.out -------------------------------------------------------------------------------- /tlpi-dist/acl/acl_view: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/acl/acl_view -------------------------------------------------------------------------------- /tlpi-dist/cap/cap_text: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/cap/cap_text -------------------------------------------------------------------------------- /tlpi-dist/fileio/copy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/fileio/copy -------------------------------------------------------------------------------- /tlpi-dist/files/chiflag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/files/chiflag -------------------------------------------------------------------------------- /tlpi-dist/files/t_chown: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/files/t_chown -------------------------------------------------------------------------------- /tlpi-dist/files/t_stat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/files/t_stat -------------------------------------------------------------------------------- /tlpi-dist/files/t_umask: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/files/t_umask -------------------------------------------------------------------------------- /tlpi-dist/files/t_utime: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/files/t_utime -------------------------------------------------------------------------------- /tlpi-dist/lib/get_num.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/get_num.o -------------------------------------------------------------------------------- /tlpi-dist/lib/libtlpi.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/libtlpi.a -------------------------------------------------------------------------------- /tlpi-dist/lib/rdwrn.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/rdwrn.o -------------------------------------------------------------------------------- /tlpi-dist/lib/signal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/signal.o -------------------------------------------------------------------------------- /tlpi-dist/mmap/mmcopy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/mmap/mmcopy -------------------------------------------------------------------------------- /tlpi-dist/mmap/t_mmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/mmap/t_mmap -------------------------------------------------------------------------------- /tlpi-dist/pgsjc/job_mon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pgsjc/job_mon -------------------------------------------------------------------------------- /tlpi-dist/proc/longjmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/proc/longjmp -------------------------------------------------------------------------------- /tlpi-dist/proc/t_getenv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/proc/t_getenv -------------------------------------------------------------------------------- /tlpi-dist/pty/unbuffer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pty/unbuffer -------------------------------------------------------------------------------- /tlpi-dist/signals/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/a.out -------------------------------------------------------------------------------- /tlpi-dist/signals/ouch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/ouch -------------------------------------------------------------------------------- /tlpi-dist/svipc/t_ftok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svipc/t_ftok -------------------------------------------------------------------------------- /tlpi-dist/time/strtime: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/time/strtime -------------------------------------------------------------------------------- /tlpi-dist/tty/new_intr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/tty/new_intr -------------------------------------------------------------------------------- /tlpi-dist/tty/no_echo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/tty/no_echo -------------------------------------------------------------------------------- /tlpi-dist/vmem/memlock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/vmem/memlock -------------------------------------------------------------------------------- /Exercise/30_2/tsb_tree.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/30_2/tsb_tree.o -------------------------------------------------------------------------------- /Exercise/31_2/tls_test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/31_2/tls_test.o -------------------------------------------------------------------------------- /Exercise/34/2/sleep.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | sleep(30); 6 | 7 | return 0; 8 | } -------------------------------------------------------------------------------- /Exercise/46_1/svmsg_send: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_1/svmsg_send -------------------------------------------------------------------------------- /Exercise/52/52_5/test.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/52/52_5/test.out -------------------------------------------------------------------------------- /Exercise/53/53_2/test.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/53/53_2/test.out -------------------------------------------------------------------------------- /Exercise/55/1/curr_time.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/1/curr_time.o -------------------------------------------------------------------------------- /Exercise/55/5/sleep_lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/5/sleep_lock -------------------------------------------------------------------------------- /Exercise/55/6/while_fcntl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/6/while_fcntl -------------------------------------------------------------------------------- /Exercise/62/3/mygetpass.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/62/3/mygetpass.o -------------------------------------------------------------------------------- /Exercise/63/1/t_poll.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/1/t_poll.out -------------------------------------------------------------------------------- /Exercise/63/2/echo_sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/2/echo_sv.out -------------------------------------------------------------------------------- /Exercise/64/2/script.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/64/2/script.out -------------------------------------------------------------------------------- /Exercise/64/3/script.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/64/3/script.out -------------------------------------------------------------------------------- /Exercise/64/5/ssh_cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/64/5/ssh_cl.out -------------------------------------------------------------------------------- /Exercise/64/5/ssh_sv.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/64/5/ssh_sv.out -------------------------------------------------------------------------------- /tlpi-dist/altio/select_mq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/select_mq -------------------------------------------------------------------------------- /tlpi-dist/altio/self_pipe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/self_pipe -------------------------------------------------------------------------------- /tlpi-dist/altio/t_select: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/t_select -------------------------------------------------------------------------------- /tlpi-dist/fileio/seek_io: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/fileio/seek_io -------------------------------------------------------------------------------- /tlpi-dist/fileio/t_readv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/fileio/t_readv -------------------------------------------------------------------------------- /tlpi-dist/files/t_utimes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/files/t_utimes -------------------------------------------------------------------------------- /tlpi-dist/filesys/t_mount: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filesys/t_mount -------------------------------------------------------------------------------- /tlpi-dist/getopt/t_getopt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/getopt/t_getopt -------------------------------------------------------------------------------- /tlpi-dist/inotify/dnotify: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/inotify/dnotify -------------------------------------------------------------------------------- /tlpi-dist/lib/curr_time.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/curr_time.o -------------------------------------------------------------------------------- /tlpi-dist/lib/pty_fork.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/pty_fork.o -------------------------------------------------------------------------------- /tlpi-dist/lib/read_line.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/read_line.o -------------------------------------------------------------------------------- /tlpi-dist/mmap/anon_mmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/mmap/anon_mmap -------------------------------------------------------------------------------- /tlpi-dist/pgsjc/t_setsid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pgsjc/t_setsid -------------------------------------------------------------------------------- /tlpi-dist/pipes/pipe_sync: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/pipe_sync -------------------------------------------------------------------------------- /tlpi-dist/pmsg/pmsg_send: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/pmsg_send -------------------------------------------------------------------------------- /tlpi-dist/proc/modify_env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/proc/modify_env -------------------------------------------------------------------------------- /tlpi-dist/proccred/idshow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/proccred/idshow -------------------------------------------------------------------------------- /tlpi-dist/procexec/orphan: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/orphan -------------------------------------------------------------------------------- /tlpi-dist/procexec/t_fork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/t_fork -------------------------------------------------------------------------------- /tlpi-dist/procres/rusage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procres/rusage -------------------------------------------------------------------------------- /tlpi-dist/psem/psem_post: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/psem_post -------------------------------------------------------------------------------- /tlpi-dist/psem/psem_wait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/psem_wait -------------------------------------------------------------------------------- /tlpi-dist/pshm/pshm_read: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pshm/pshm_read -------------------------------------------------------------------------------- /tlpi-dist/pshm/pshm_write: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pshm/pshm_write -------------------------------------------------------------------------------- /tlpi-dist/shlibs/dynload: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/shlibs/dynload -------------------------------------------------------------------------------- /tlpi-dist/signals/intquit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/intquit -------------------------------------------------------------------------------- /tlpi-dist/signals/t_kill: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/t_kill -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_ls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_ls -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_rm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_rm -------------------------------------------------------------------------------- /tlpi-dist/svsem/svsem_mon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svsem/svsem_mon -------------------------------------------------------------------------------- /tlpi-dist/svsem/svsem_op: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svsem/svsem_op -------------------------------------------------------------------------------- /tlpi-dist/svsem/svsem_rm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svsem/svsem_rm -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_mon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_mon -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_rm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_rm -------------------------------------------------------------------------------- /tlpi-dist/sysinfo/t_uname: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sysinfo/t_uname -------------------------------------------------------------------------------- /tlpi-dist/time/show_time: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/time/show_time -------------------------------------------------------------------------------- /tlpi-dist/vmem/t_mprotect: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/vmem/t_mprotect -------------------------------------------------------------------------------- /Exercise/31_2/tls_dirname.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/31_2/tls_dirname.o -------------------------------------------------------------------------------- /Exercise/31_2/ts_dirname.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/31_2/ts_dirname.o -------------------------------------------------------------------------------- /Exercise/38/1/38_1.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | echo "sleep 10s start" 4 | sleep 10 5 | echo "sleep finish" 6 | a 7 | -------------------------------------------------------------------------------- /Exercise/42/libmod.so.1.0.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/42/libmod.so.1.0.1 -------------------------------------------------------------------------------- /Exercise/42/libmod1.so.1.0.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/42/libmod1.so.1.0.1 -------------------------------------------------------------------------------- /Exercise/42/libmod2.so.1.0.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/42/libmod2.so.1.0.1 -------------------------------------------------------------------------------- /Exercise/46_1/svmsg_create: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_1/svmsg_create -------------------------------------------------------------------------------- /Exercise/46_1/svmsg_receive: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_1/svmsg_receive -------------------------------------------------------------------------------- /Exercise/55/9/non_mand/aout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/9/non_mand/aout -------------------------------------------------------------------------------- /Exercise/55/9/non_mand/bout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/9/non_mand/bout -------------------------------------------------------------------------------- /Exercise/63/8/demo_sigio.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/8/demo_sigio.out -------------------------------------------------------------------------------- /Exercise/64/7/unbuffer.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/64/7/unbuffer.out -------------------------------------------------------------------------------- /tlpi-dist/altio/demo_sigio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/demo_sigio -------------------------------------------------------------------------------- /tlpi-dist/altio/epoll_input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/epoll_input -------------------------------------------------------------------------------- /tlpi-dist/altio/poll_pipes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/poll_pipes -------------------------------------------------------------------------------- /tlpi-dist/cap/cap_launcher: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/cap/cap_launcher -------------------------------------------------------------------------------- /tlpi-dist/cap/demo_file_caps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/cap/demo_file_caps -------------------------------------------------------------------------------- /tlpi-dist/cap/show_secbits: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/cap/show_secbits -------------------------------------------------------------------------------- /tlpi-dist/cap/t_cap_get_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/cap/t_cap_get_file -------------------------------------------------------------------------------- /tlpi-dist/cap/t_cap_get_pid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/cap/t_cap_get_pid -------------------------------------------------------------------------------- /tlpi-dist/cap/t_cap_set_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/cap/t_cap_set_file -------------------------------------------------------------------------------- /tlpi-dist/daemons/t_syslog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/daemons/t_syslog -------------------------------------------------------------------------------- /tlpi-dist/filebuff/mix23io: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filebuff/mix23io -------------------------------------------------------------------------------- /tlpi-dist/fileio/large_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/fileio/large_file -------------------------------------------------------------------------------- /tlpi-dist/fileio/t_truncate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/fileio/t_truncate -------------------------------------------------------------------------------- /tlpi-dist/filelock/t_flock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filelock/t_flock -------------------------------------------------------------------------------- /tlpi-dist/filesys/t_statfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filesys/t_statfs -------------------------------------------------------------------------------- /tlpi-dist/filesys/t_statvfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filesys/t_statvfs -------------------------------------------------------------------------------- /tlpi-dist/filesys/t_umount: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filesys/t_umount -------------------------------------------------------------------------------- /tlpi-dist/inotify/rand_dtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/inotify/rand_dtree -------------------------------------------------------------------------------- /tlpi-dist/lib/binary_sems.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/binary_sems.o -------------------------------------------------------------------------------- /tlpi-dist/lib/event_flags.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/event_flags.o -------------------------------------------------------------------------------- /tlpi-dist/lib/file_perms.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/file_perms.o -------------------------------------------------------------------------------- /tlpi-dist/lib/inet_sockets.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/inet_sockets.o -------------------------------------------------------------------------------- /tlpi-dist/lib/print_rlimit.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/print_rlimit.o -------------------------------------------------------------------------------- /tlpi-dist/lib/print_rusage.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/print_rusage.o -------------------------------------------------------------------------------- /tlpi-dist/lib/unix_sockets.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/unix_sockets.o -------------------------------------------------------------------------------- /tlpi-dist/pgsjc/catch_SIGHUP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pgsjc/catch_SIGHUP -------------------------------------------------------------------------------- /tlpi-dist/pgsjc/disc_SIGHUP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pgsjc/disc_SIGHUP -------------------------------------------------------------------------------- /tlpi-dist/pipes/change_case: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/change_case -------------------------------------------------------------------------------- /tlpi-dist/pipes/pipe_ls_wc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/pipe_ls_wc -------------------------------------------------------------------------------- /tlpi-dist/pipes/popen_glob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/popen_glob -------------------------------------------------------------------------------- /tlpi-dist/pipes/simple_pipe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/simple_pipe -------------------------------------------------------------------------------- /tlpi-dist/pmsg/mq_notify_sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/mq_notify_sig -------------------------------------------------------------------------------- /tlpi-dist/pmsg/pmsg_create: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/pmsg_create -------------------------------------------------------------------------------- /tlpi-dist/pmsg/pmsg_getattr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/pmsg_getattr -------------------------------------------------------------------------------- /tlpi-dist/pmsg/pmsg_receive: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/pmsg_receive -------------------------------------------------------------------------------- /tlpi-dist/pmsg/pmsg_unlink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/pmsg_unlink -------------------------------------------------------------------------------- /tlpi-dist/proc/bad_longjmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/proc/bad_longjmp -------------------------------------------------------------------------------- /tlpi-dist/proc/display_env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/proc/display_env -------------------------------------------------------------------------------- /tlpi-dist/proc/setjmp_vars: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/proc/setjmp_vars -------------------------------------------------------------------------------- /tlpi-dist/procexec/acct_on: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/acct_on -------------------------------------------------------------------------------- /tlpi-dist/procexec/acct_view: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/acct_view -------------------------------------------------------------------------------- /tlpi-dist/procexec/envargs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/envargs -------------------------------------------------------------------------------- /tlpi-dist/procexec/footprint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/footprint -------------------------------------------------------------------------------- /tlpi-dist/procexec/t_clone: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/t_clone -------------------------------------------------------------------------------- /tlpi-dist/procexec/t_execl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/t_execl -------------------------------------------------------------------------------- /tlpi-dist/procexec/t_execle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/t_execle -------------------------------------------------------------------------------- /tlpi-dist/procexec/t_execlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/t_execlp -------------------------------------------------------------------------------- /tlpi-dist/procexec/t_execve: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/t_execve -------------------------------------------------------------------------------- /tlpi-dist/procexec/t_system: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/t_system -------------------------------------------------------------------------------- /tlpi-dist/procexec/t_vfork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/t_vfork -------------------------------------------------------------------------------- /tlpi-dist/procpri/sched_set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procpri/sched_set -------------------------------------------------------------------------------- /tlpi-dist/procpri/sched_view: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procpri/sched_view -------------------------------------------------------------------------------- /tlpi-dist/psem/psem_create: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/psem_create -------------------------------------------------------------------------------- /tlpi-dist/psem/psem_getvalue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/psem_getvalue -------------------------------------------------------------------------------- /tlpi-dist/psem/psem_trywait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/psem_trywait -------------------------------------------------------------------------------- /tlpi-dist/psem/psem_unlink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/psem_unlink -------------------------------------------------------------------------------- /tlpi-dist/pshm/pshm_create: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pshm/pshm_create -------------------------------------------------------------------------------- /tlpi-dist/pshm/pshm_unlink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pshm/pshm_unlink -------------------------------------------------------------------------------- /tlpi-dist/shlibs/dynload.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/shlibs/dynload.o -------------------------------------------------------------------------------- /tlpi-dist/signals/sig_sender: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/sig_sender -------------------------------------------------------------------------------- /tlpi-dist/signals/t_sigqueue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/t_sigqueue -------------------------------------------------------------------------------- /tlpi-dist/sockets/id_echo_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/id_echo_cl -------------------------------------------------------------------------------- /tlpi-dist/sockets/id_echo_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/id_echo_sv -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_echo_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_echo_cl -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_echo_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_echo_sv -------------------------------------------------------------------------------- /tlpi-dist/sockets/socknames: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/socknames -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_xfr_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_xfr_cl -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_xfr_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_xfr_sv -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_create: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_create -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_info -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_send: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_send -------------------------------------------------------------------------------- /tlpi-dist/svsem/svsem_create: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svsem/svsem_create -------------------------------------------------------------------------------- /tlpi-dist/svsem/svsem_demo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svsem/svsem_demo -------------------------------------------------------------------------------- /tlpi-dist/svsem/svsem_info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svsem/svsem_info -------------------------------------------------------------------------------- /tlpi-dist/svsem/svsem_setall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svsem/svsem_setall -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_attach: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_attach -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_create: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_create -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_info -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_lock -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_unlock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_unlock -------------------------------------------------------------------------------- /tlpi-dist/syslim/t_fpathconf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/syslim/t_fpathconf -------------------------------------------------------------------------------- /tlpi-dist/syslim/t_sysconf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/syslim/t_sysconf -------------------------------------------------------------------------------- /tlpi-dist/time/calendar_time: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/time/calendar_time -------------------------------------------------------------------------------- /tlpi-dist/time/process_time: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/time/process_time -------------------------------------------------------------------------------- /tlpi-dist/timers/clock_times: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/clock_times -------------------------------------------------------------------------------- /tlpi-dist/timers/cpu_burner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/cpu_burner -------------------------------------------------------------------------------- /tlpi-dist/timers/real_timer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/real_timer -------------------------------------------------------------------------------- /tlpi-dist/timers/t_nanosleep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/t_nanosleep -------------------------------------------------------------------------------- /tlpi-dist/timers/timed_read: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/timed_read -------------------------------------------------------------------------------- /tlpi-dist/tty/demo_SIGWINCH: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/tty/demo_SIGWINCH -------------------------------------------------------------------------------- /tlpi-dist/xattr/t_setxattr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/xattr/t_setxattr -------------------------------------------------------------------------------- /tlpi-dist/xattr/xattr_view: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/xattr/xattr_view -------------------------------------------------------------------------------- /Exercise/33_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | return 0; 8 | } -------------------------------------------------------------------------------- /Exercise/47/47_6/binary_fifo.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/47/47_6/binary_fifo.o -------------------------------------------------------------------------------- /Exercise/57/0/und.h: -------------------------------------------------------------------------------- 1 | #ifndef UND_H 2 | #define UND_H 3 | 4 | #define SOCKET_PATH "/tmp/sv_socket_file" 5 | 6 | #endif -------------------------------------------------------------------------------- /Exercise/62/2/myttyname.h: -------------------------------------------------------------------------------- 1 | #ifndef MYTTYNAME 2 | #define MYTTYNAME 3 | 4 | char *my_ttyname(int fd); 5 | 6 | #endif -------------------------------------------------------------------------------- /Exercise/63/2/echo_tcp_cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/2/echo_tcp_cl.out -------------------------------------------------------------------------------- /Exercise/63/2/echo_unp_cl.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/63/2/echo_unp_cl.out -------------------------------------------------------------------------------- /Exercise/64/4/script_time.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/64/4/script_time.out -------------------------------------------------------------------------------- /Exercise/script_exercise/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/script_exercise/a.out -------------------------------------------------------------------------------- /Exercise/script_exercise/longest_line.awk: -------------------------------------------------------------------------------- 1 | #! /usr/bin/awk -f 2 | length > max { max = length; } 3 | END { print max; } -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/t_unlink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/dirs_links/t_unlink -------------------------------------------------------------------------------- /tlpi-dist/filebuff/direct_read: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filebuff/direct_read -------------------------------------------------------------------------------- /tlpi-dist/filebuff/write_bytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filebuff/write_bytes -------------------------------------------------------------------------------- /tlpi-dist/fileio/atomic_append: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/fileio/atomic_append -------------------------------------------------------------------------------- /tlpi-dist/inotify/demo_inotify: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/inotify/demo_inotify -------------------------------------------------------------------------------- /tlpi-dist/lib/alt_functions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/alt_functions.o -------------------------------------------------------------------------------- /tlpi-dist/lib/become_daemon.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/become_daemon.o -------------------------------------------------------------------------------- /tlpi-dist/lib/cap_functions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/cap_functions.o -------------------------------------------------------------------------------- /tlpi-dist/lib/read_line_buf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/read_line_buf.o -------------------------------------------------------------------------------- /tlpi-dist/lib/region_locking.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/region_locking.o -------------------------------------------------------------------------------- /tlpi-dist/lib/scm_functions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/scm_functions.o -------------------------------------------------------------------------------- /tlpi-dist/lib/tty_functions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/tty_functions.o -------------------------------------------------------------------------------- /tlpi-dist/lib/ugid_functions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/ugid_functions.o -------------------------------------------------------------------------------- /tlpi-dist/loginacct/dump_utmpx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/loginacct/dump_utmpx -------------------------------------------------------------------------------- /tlpi-dist/procexec/closeonexec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/closeonexec -------------------------------------------------------------------------------- /tlpi-dist/procexec/demo_clone: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/demo_clone -------------------------------------------------------------------------------- /tlpi-dist/procexec/make_zombie: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/make_zombie -------------------------------------------------------------------------------- /tlpi-dist/procexec/multi_wait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/multi_wait -------------------------------------------------------------------------------- /tlpi-dist/procres/rlimit_nproc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procres/rlimit_nproc -------------------------------------------------------------------------------- /tlpi-dist/procres/rusage_wait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procres/rusage_wait -------------------------------------------------------------------------------- /tlpi-dist/psem/psem_timedwait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/psem_timedwait -------------------------------------------------------------------------------- /tlpi-dist/signals/catch_rtsigs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/catch_rtsigs -------------------------------------------------------------------------------- /tlpi-dist/signals/demo_SIGFPE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/demo_SIGFPE -------------------------------------------------------------------------------- /tlpi-dist/signals/nonreentrant: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/nonreentrant -------------------------------------------------------------------------------- /tlpi-dist/signals/sig_receiver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/sig_receiver -------------------------------------------------------------------------------- /tlpi-dist/signals/t_sigsuspend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/t_sigsuspend -------------------------------------------------------------------------------- /tlpi-dist/sockets/i6d_ucase_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/i6d_ucase_cl -------------------------------------------------------------------------------- /tlpi-dist/sockets/i6d_ucase_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/i6d_ucase_sv -------------------------------------------------------------------------------- /tlpi-dist/sockets/id_echo_cl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/id_echo_cl.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/id_echo_sv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/id_echo_sv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_seqnum_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_seqnum_cl -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_seqnum_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_seqnum_sv -------------------------------------------------------------------------------- /tlpi-dist/sockets/ud_ucase_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/ud_ucase_cl -------------------------------------------------------------------------------- /tlpi-dist/sockets/ud_ucase_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/ud_ucase_sv -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_xfr_cl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_xfr_cl.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_xfr_sv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_xfr_sv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_xfr_v2_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_xfr_v2_cl -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_xfr_v2_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_xfr_v2_sv -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_chqbytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_chqbytes -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_receive: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_receive -------------------------------------------------------------------------------- /tlpi-dist/svsem/event_flags.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svsem/event_flags.o -------------------------------------------------------------------------------- /tlpi-dist/threads/prod_condvar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/prod_condvar -------------------------------------------------------------------------------- /tlpi-dist/threads/thread_incr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/thread_incr -------------------------------------------------------------------------------- /tlpi-dist/timers/demo_timerfd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/demo_timerfd -------------------------------------------------------------------------------- /tlpi-dist/timers/ptmr_null_evp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/ptmr_null_evp -------------------------------------------------------------------------------- /Exercise/46_2/msg_seqnum_client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_2/msg_seqnum_client -------------------------------------------------------------------------------- /Exercise/46_2/msg_seqnum_client.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_2/msg_seqnum_client.o -------------------------------------------------------------------------------- /Exercise/46_2/msg_seqnum_server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_2/msg_seqnum_server -------------------------------------------------------------------------------- /Exercise/46_2/msg_seqnum_server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_2/msg_seqnum_server.o -------------------------------------------------------------------------------- /Exercise/46_45/svmsg_file_client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_45/svmsg_file_client -------------------------------------------------------------------------------- /Exercise/46_45/svmsg_file_server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_45/svmsg_file_server -------------------------------------------------------------------------------- /Exercise/60/2/echo_inetd_test.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/60/2/echo_inetd_test.out -------------------------------------------------------------------------------- /Exercise/62/3/libmygetpass.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/62/3/libmygetpass.so.1 -------------------------------------------------------------------------------- /Exercise/64/4/script_replay.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/64/4/script_replay.out -------------------------------------------------------------------------------- /tlpi-dist/altio/epoll_flags_fork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/epoll_flags_fork -------------------------------------------------------------------------------- /tlpi-dist/cap/check_password_caps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/cap/check_password_caps -------------------------------------------------------------------------------- /tlpi-dist/daemons/daemon_SIGHUP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/daemons/daemon_SIGHUP -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/bad_symlink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/dirs_links/bad_symlink -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/list_files: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/dirs_links/list_files -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/view_symlink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/dirs_links/view_symlink -------------------------------------------------------------------------------- /tlpi-dist/filebuff/mix23_linebuff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filebuff/mix23_linebuff -------------------------------------------------------------------------------- /tlpi-dist/inotify/inotify_dtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/inotify/inotify_dtree -------------------------------------------------------------------------------- /tlpi-dist/lib/create_pid_file.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/create_pid_file.o -------------------------------------------------------------------------------- /tlpi-dist/lib/error_functions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/error_functions.o -------------------------------------------------------------------------------- /tlpi-dist/lib/print_wait_status.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/print_wait_status.o -------------------------------------------------------------------------------- /tlpi-dist/lib/pty_master_open.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/pty_master_open.o -------------------------------------------------------------------------------- /tlpi-dist/lib/signal_functions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/signal_functions.o -------------------------------------------------------------------------------- /tlpi-dist/lib/userns_functions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/userns_functions.o -------------------------------------------------------------------------------- /tlpi-dist/loginacct/utmpx_login: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/loginacct/utmpx_login -------------------------------------------------------------------------------- /tlpi-dist/loginacct/view_lastlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/loginacct/view_lastlog -------------------------------------------------------------------------------- /tlpi-dist/memalloc/free_and_sbrk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/memalloc/free_and_sbrk -------------------------------------------------------------------------------- /tlpi-dist/mmap/t_remap_file_pages: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/mmap/t_remap_file_pages -------------------------------------------------------------------------------- /tlpi-dist/pgsjc/handling_SIGTSTP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pgsjc/handling_SIGTSTP -------------------------------------------------------------------------------- /tlpi-dist/pmsg/mq_notify_thread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/mq_notify_thread -------------------------------------------------------------------------------- /tlpi-dist/procexec/acct_v3_view: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/acct_v3_view -------------------------------------------------------------------------------- /tlpi-dist/procexec/child_status: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/child_status -------------------------------------------------------------------------------- /tlpi-dist/procexec/exit_handlers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/exit_handlers -------------------------------------------------------------------------------- /tlpi-dist/procexec/fork_sig_sync: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/fork_sig_sync -------------------------------------------------------------------------------- /tlpi-dist/procexec/fork_stdio_buf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/fork_stdio_buf -------------------------------------------------------------------------------- /tlpi-dist/procexec/longest_line.awk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/awk -f 2 | length > max { max = length; } 3 | END { print max; } 4 | -------------------------------------------------------------------------------- /tlpi-dist/procexec/multi_SIGCHLD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/multi_SIGCHLD -------------------------------------------------------------------------------- /tlpi-dist/procexec/pdeath_signal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/pdeath_signal -------------------------------------------------------------------------------- /tlpi-dist/procexec/vfork_fd_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/vfork_fd_test -------------------------------------------------------------------------------- /tlpi-dist/procpri/demo_sched_fifo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procpri/demo_sched_fifo -------------------------------------------------------------------------------- /tlpi-dist/procpri/t_setpriority: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procpri/t_setpriority -------------------------------------------------------------------------------- /tlpi-dist/progconc/syscall_speed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/progconc/syscall_speed -------------------------------------------------------------------------------- /tlpi-dist/psem/psem_timedwait.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/psem_timedwait.o -------------------------------------------------------------------------------- /tlpi-dist/psem/thread_incr_psem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/psem/thread_incr_psem -------------------------------------------------------------------------------- /tlpi-dist/signals/nonreentrant.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/nonreentrant.o -------------------------------------------------------------------------------- /tlpi-dist/signals/sigmask_longjmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/sigmask_longjmp -------------------------------------------------------------------------------- /tlpi-dist/signals/signalfd_sigval: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/signalfd_sigval -------------------------------------------------------------------------------- /tlpi-dist/signals/t_sigaltstack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/t_sigaltstack -------------------------------------------------------------------------------- /tlpi-dist/signals/t_sigwaitinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/t_sigwaitinfo -------------------------------------------------------------------------------- /tlpi-dist/sockets/i6d_ucase_cl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/i6d_ucase_cl.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/i6d_ucase_sv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/i6d_ucase_sv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_echo_v2_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_echo_v2_sv -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_seqnum_cl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_seqnum_cl.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_seqnum_sv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_seqnum_sv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_seqnum_v2_cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_seqnum_v2_cl -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_seqnum_v2_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_seqnum_v2_sv -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_cred_recv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_cred_recv -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_cred_recv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_cred_recv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_cred_send: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_cred_send -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_cred_send.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_cred_send.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_multi_recv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_multi_recv -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_multi_send: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_multi_send -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_rights_recv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_rights_recv -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_rights_send: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_rights_send -------------------------------------------------------------------------------- /tlpi-dist/sockets/t_gethostbyname: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/t_gethostbyname -------------------------------------------------------------------------------- /tlpi-dist/sockets/t_getservbyname: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/t_getservbyname -------------------------------------------------------------------------------- /tlpi-dist/sockets/ud_ucase_cl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/ud_ucase_cl.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/ud_ucase_sv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/ud_ucase_sv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_xfr_v2_cl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_xfr_v2_cl.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_xfr_v2_sv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_xfr_v2_sv.o -------------------------------------------------------------------------------- /tlpi-dist/svipc/svmsg_demo_server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svipc/svmsg_demo_server -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_file_client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_file_client -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_file_server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_file_server -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_xfr_reader: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_xfr_reader -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_xfr_writer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_xfr_writer -------------------------------------------------------------------------------- /tlpi-dist/sysinfo/procfs_pidmax: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sysinfo/procfs_pidmax -------------------------------------------------------------------------------- /tlpi-dist/sysinfo/procfs_user_exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sysinfo/procfs_user_exe -------------------------------------------------------------------------------- /tlpi-dist/threads/detached_attrib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/detached_attrib -------------------------------------------------------------------------------- /tlpi-dist/threads/one_time_init: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/one_time_init -------------------------------------------------------------------------------- /tlpi-dist/threads/prod_no_condvar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/prod_no_condvar -------------------------------------------------------------------------------- /tlpi-dist/threads/simple_thread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/simple_thread -------------------------------------------------------------------------------- /tlpi-dist/threads/thread_cancel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/thread_cancel -------------------------------------------------------------------------------- /tlpi-dist/threads/thread_cleanup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/thread_cleanup -------------------------------------------------------------------------------- /tlpi-dist/timers/cpu_multi_burner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/cpu_multi_burner -------------------------------------------------------------------------------- /tlpi-dist/tty/test_tty_functions: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/tty/test_tty_functions -------------------------------------------------------------------------------- /tlpi-dist/users_groups/t_getpwent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/users_groups/t_getpwent -------------------------------------------------------------------------------- /tlpi-dist/vdso/vdso_gettimeofday: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/vdso/vdso_gettimeofday -------------------------------------------------------------------------------- /tlpi-dist/vmem/madvise_dontneed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/vmem/madvise_dontneed -------------------------------------------------------------------------------- /Exercise/44_3456/fifo_seqnum_client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/44_3456/fifo_seqnum_client -------------------------------------------------------------------------------- /Exercise/44_3456/fifo_seqnum_server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/44_3456/fifo_seqnum_server -------------------------------------------------------------------------------- /Exercise/46_45/svmsg_file_client.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_45/svmsg_file_client.o -------------------------------------------------------------------------------- /Exercise/46_45/svmsg_file_server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/46_45/svmsg_file_server.o -------------------------------------------------------------------------------- /Exercise/55/1/libcurrtime.so.1.0.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/55/1/libcurrtime.so.1.0.1 -------------------------------------------------------------------------------- /Exercise/62/2/libmyttyname.so.1.0.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/62/2/libmyttyname.so.1.0.1 -------------------------------------------------------------------------------- /Exercise/62/3/mygetpass.h: -------------------------------------------------------------------------------- 1 | #ifndef MYGETPASS 2 | #define MYGETPASS 3 | 4 | char *mygetpass(const char *prompt); 5 | 6 | #endif -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/nftw_dir_tree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/dirs_links/nftw_dir_tree -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/t_dirbasename: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/dirs_links/t_dirbasename -------------------------------------------------------------------------------- /tlpi-dist/fileio/bad_exclusive_open: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/fileio/bad_exclusive_open -------------------------------------------------------------------------------- /tlpi-dist/fileio/multi_descriptors: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/fileio/multi_descriptors -------------------------------------------------------------------------------- /tlpi-dist/filelock/i_fcntl_locking: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filelock/i_fcntl_locking -------------------------------------------------------------------------------- /tlpi-dist/lib/itimerspec_from_str.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/lib/itimerspec_from_str.o -------------------------------------------------------------------------------- /tlpi-dist/pipes/fifo_seqnum_client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/fifo_seqnum_client -------------------------------------------------------------------------------- /tlpi-dist/pipes/fifo_seqnum_server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/fifo_seqnum_server -------------------------------------------------------------------------------- /tlpi-dist/pmsg/mq_notify_via_signal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/mq_notify_via_signal -------------------------------------------------------------------------------- /tlpi-dist/pmsg/mq_notify_via_thread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/mq_notify_via_thread -------------------------------------------------------------------------------- /tlpi-dist/procexec/pdeath_signal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/pdeath_signal.o -------------------------------------------------------------------------------- /tlpi-dist/shlibs/version_scripts/sv_v1.map: -------------------------------------------------------------------------------- 1 | VER_1 { 2 | global: xyz; 3 | local: *; # Hide all other symbols 4 | }; 5 | -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_echo_inetd_sv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_echo_inetd_sv -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_seqnum_v2_cl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_seqnum_v2_cl.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/is_seqnum_v2_sv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/is_seqnum_v2_sv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_multi_recv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_multi_recv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_multi_send.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_multi_send.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_rights_recv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_rights_recv.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/scm_rights_send.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/scm_rights_send.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/us_abstract_bind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/us_abstract_bind -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_file_client.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_file_client.o -------------------------------------------------------------------------------- /tlpi-dist/svmsg/svmsg_file_server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svmsg/svmsg_file_server.o -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_xfr_reader.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_xfr_reader.o -------------------------------------------------------------------------------- /tlpi-dist/svshm/svshm_xfr_writer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/svshm/svshm_xfr_writer.o -------------------------------------------------------------------------------- /tlpi-dist/threads/thread_incr_mutex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/thread_incr_mutex -------------------------------------------------------------------------------- /tlpi-dist/threads/thread_lock_speed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/thread_lock_speed -------------------------------------------------------------------------------- /tlpi-dist/threads/thread_multijoin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/thread_multijoin -------------------------------------------------------------------------------- /tlpi-dist/timers/ptmr_sigev_signal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/ptmr_sigev_signal -------------------------------------------------------------------------------- /tlpi-dist/timers/ptmr_sigev_thread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/ptmr_sigev_thread -------------------------------------------------------------------------------- /tlpi-dist/timers/t_clock_nanosleep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/t_clock_nanosleep -------------------------------------------------------------------------------- /tlpi-dist/users_groups/t_getpwnam_r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/users_groups/t_getpwnam_r -------------------------------------------------------------------------------- /tlpi-dist/vdso/syscall_gettimeofday: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/vdso/syscall_gettimeofday -------------------------------------------------------------------------------- /Exercise/44_3456/fifo_seqnum_client.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/44_3456/fifo_seqnum_client.o -------------------------------------------------------------------------------- /Exercise/44_3456/fifo_seqnum_server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/Exercise/44_3456/fifo_seqnum_server.o -------------------------------------------------------------------------------- /tlpi-dist/altio/multithread_epoll_wait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/multithread_epoll_wait -------------------------------------------------------------------------------- /tlpi-dist/daemons/test_become_daemon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/daemons/test_become_daemon -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/file_type_stats: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/dirs_links/file_type_stats -------------------------------------------------------------------------------- /tlpi-dist/filebuff/write_bytes_fsync: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filebuff/write_bytes_fsync -------------------------------------------------------------------------------- /tlpi-dist/filebuff/write_bytes_o_sync: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filebuff/write_bytes_o_sync -------------------------------------------------------------------------------- /tlpi-dist/pgsjc/orphaned_pgrp_SIGHUP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pgsjc/orphaned_pgrp_SIGHUP -------------------------------------------------------------------------------- /tlpi-dist/pipes/fifo_seqnum_client.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/fifo_seqnum_client.o -------------------------------------------------------------------------------- /tlpi-dist/pipes/fifo_seqnum_server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pipes/fifo_seqnum_server.o -------------------------------------------------------------------------------- /tlpi-dist/pmsg/mq_notify_sigwaitinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/pmsg/mq_notify_sigwaitinfo -------------------------------------------------------------------------------- /tlpi-dist/procexec/fork_file_sharing: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/fork_file_sharing -------------------------------------------------------------------------------- /tlpi-dist/procexec/fork_whos_on_first: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procexec/fork_whos_on_first -------------------------------------------------------------------------------- /tlpi-dist/procpri/t_sched_getaffinity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procpri/t_sched_getaffinity -------------------------------------------------------------------------------- /tlpi-dist/procpri/t_sched_setaffinity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/procpri/t_sched_setaffinity -------------------------------------------------------------------------------- /tlpi-dist/shlibs/version_scripts/vis.map: -------------------------------------------------------------------------------- 1 | VER_1 { 2 | global: 3 | vis_f1; 4 | vis_f2; 5 | local: 6 | *; 7 | }; 8 | -------------------------------------------------------------------------------- /tlpi-dist/signals/ignore_pending_sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/ignore_pending_sig -------------------------------------------------------------------------------- /tlpi-dist/signals/sig_speed_sigsuspend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/sig_speed_sigsuspend -------------------------------------------------------------------------------- /tlpi-dist/signals/sigmask_siglongjmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/sigmask_siglongjmp -------------------------------------------------------------------------------- /tlpi-dist/signals/sigmask_siglongjmp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/signals/sigmask_siglongjmp.o -------------------------------------------------------------------------------- /tlpi-dist/sockets/list_host_addresses: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/sockets/list_host_addresses -------------------------------------------------------------------------------- /tlpi-dist/threads/pthread_barrier_demo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/pthread_barrier_demo -------------------------------------------------------------------------------- /tlpi-dist/threads/thread_incr_rwlock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/thread_incr_rwlock -------------------------------------------------------------------------------- /tlpi-dist/threads/thread_incr_spinlock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/threads/thread_incr_spinlock -------------------------------------------------------------------------------- /tlpi-dist/users_groups/check_password: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/users_groups/check_password -------------------------------------------------------------------------------- /tlpi-dist/altio/multithread_epoll_wait.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/altio/multithread_epoll_wait.o -------------------------------------------------------------------------------- /tlpi-dist/filebuff/write_bytes_fdatasync: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/filebuff/write_bytes_fdatasync -------------------------------------------------------------------------------- /tlpi-dist/timers/cpu_multithread_burner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/timers/cpu_multithread_burner -------------------------------------------------------------------------------- /tlpi-dist/users_groups/check_password.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/users_groups/check_password.o -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/list_files_readdir_r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunhuiquan/tlpi-learn/HEAD/tlpi-dist/dirs_links/list_files_readdir_r -------------------------------------------------------------------------------- /Exercise/27_3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | execl("27_3.sh", "27_3.sh", NULL); 7 | exit(127); 8 | } -------------------------------------------------------------------------------- /Exercise/18/1/18_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | sleep(100); 7 | printf("a\n"); 8 | 9 | return 0; 10 | } -------------------------------------------------------------------------------- /Exercise/62/1/file: -------------------------------------------------------------------------------- 1 | STDIN_FILENO is referring to a terminal. 2 | --------------------------------------------- 3 | STDOUT_FILENO is not referring to a terminal. 4 | -------------------------------------------------------------------------------- /tlpi-dist/shlibs/version_scripts/sv_v2.map: -------------------------------------------------------------------------------- 1 | VER_1 { 2 | global: xyz; 3 | local: *; # Hide all other symbols 4 | }; 5 | 6 | VER_2 { 7 | global: pqr; 8 | } VER_1; 9 | -------------------------------------------------------------------------------- /Exercise/13/13_4.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | printf("aaa\n"); 7 | write(STDOUT_FILENO, "bbb\n", 4); 8 | 9 | return 0; 10 | } -------------------------------------------------------------------------------- /Exercise/59/3/in_xfr.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "tlpi_hdr.h" 4 | #include "myinet.h" 5 | 6 | #define PORT_NUMBER "50000" 7 | 8 | #define BUF_SIZE 100 9 | -------------------------------------------------------------------------------- /tlpi-dist/shlibs/Demo_no_lib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Build a program without using libraries 4 | 5 | cc -c -g prog.c mod1.c mod2.c mod3.c 6 | cc -g -o prog_nolib prog.o mod1.o mod2.o mod3.o 7 | -------------------------------------------------------------------------------- /Exercise/48/48_4/creat_shm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | if (shmget(IPC_PRIVATE, 1024, 0666) == -1) 7 | errExit("shmget"); 8 | 9 | return 0; 10 | } -------------------------------------------------------------------------------- /Exercise/30_2/test.c: -------------------------------------------------------------------------------- 1 | #include "tsb_tree.h" 2 | #include 3 | #include 4 | 5 | #define PTHREADS_NUM 10 6 | 7 | pthread_t p[PTHREADS_NUM]; 8 | 9 | int main() 10 | { 11 | 12 | return 0; 13 | } -------------------------------------------------------------------------------- /Exercise/47/semun.h: -------------------------------------------------------------------------------- 1 | #ifndef SEMUN_H 2 | #define SEMUN_H 3 | 4 | union semun 5 | { 6 | int val; 7 | struct semid_ds *buf; 8 | unsigned short *array; 9 | struct seminfo *__buf; 10 | }; 11 | 12 | #endif -------------------------------------------------------------------------------- /Exercise/57/1/u.h: -------------------------------------------------------------------------------- 1 | #ifndef U_H 2 | #define U_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define SOCKET_PATH "/tmp/my_socket" 9 | #define MSG_SZ 100 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Exercise/13/out.txt: -------------------------------------------------------------------------------- 1 | 111 2 | 2222 3 | 333 4 | 4444 5 | 55555 6 | 6666 7 | 7777 8 | 8888 9 | 999 10 | 1010 11 | 1111 12 | 1212 13 | 1313 14 | 1414 15 | 1515 16 | 1616 17 | 1717 18 | 1818 19 | 1919 20 | 2020 21 | 2121 22 | 2222 -------------------------------------------------------------------------------- /Exercise/34/4/log: -------------------------------------------------------------------------------- 1 | PID of parent process is: 122999 2 | Foreground process group ID is: 122829 3 | PID=122999 PGID=122999 4 | PID=123000 PGID=123000 5 | PID=123001 PGID=122999 6 | PID 122999: main caught signal 1 (Hangup) 7 | -------------------------------------------------------------------------------- /Exercise/57/2/myund.h: -------------------------------------------------------------------------------- 1 | #ifndef MYUND_H 2 | #define MYUND_H 3 | 4 | #include 5 | #include 6 | #include "tlpi_hdr.h" 7 | 8 | #define SV_SOCK_PATH "/tmp/us_xfr" 9 | 10 | #define BUF_SIZE 100 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /Exercise/38/2/exec.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | printf("effictive user id:%ld exec successfully\n", (long)geteuid()); 7 | for (int i = 0; i < argc; ++i) 8 | printf("%s\n", argv[i]); 9 | } -------------------------------------------------------------------------------- /Exercise/47/47_6/binary_fifo.h: -------------------------------------------------------------------------------- 1 | #ifndef BINARY_FIFO_H 2 | #define BINARY_FIFO_H 3 | 4 | int init(const char *fifo, int *rfd, int *wfd); 5 | 6 | int reserve(int rfd); 7 | 8 | int reserveNB(int rfd); 9 | 10 | int release(int wfd); 11 | 12 | #endif -------------------------------------------------------------------------------- /Exercise/8_1.c: -------------------------------------------------------------------------------- 1 | #include "tlpi_hdr.h" 2 | #include 3 | 4 | int main() 5 | { 6 | struct passwd *pa = getpwnam("root"); 7 | struct passwd *pb = getpwnam("water"); 8 | printf("%u\n", pa->pw_uid); 9 | printf("%u\n", pb->pw_uid); 10 | } -------------------------------------------------------------------------------- /Exercise/46_1/Makefile: -------------------------------------------------------------------------------- 1 | TLPI_LIB = /usr/local/lib/libtlpi.a 2 | GEN_EXE = svmsg_create svmsg_send svmsg_receive 3 | 4 | all: ${GEN_EXE} 5 | 6 | clean: 7 | ${RM} ${GEN_EXE} *.o 8 | 9 | showall: 10 | @ echo ${GEN_EXE} 11 | 12 | ${GEN_EXE} : ${TLPI_LIB} 13 | -------------------------------------------------------------------------------- /Exercise/script_exercise/exec_awk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "tlpi_hdr.h" 3 | 4 | int main() 5 | { 6 | execl("longest_line.awk", "longest_line.awk", "input.txt", (char *)NULL); 7 | 8 | printf("%s\n", strerror(errno)); 9 | 10 | return 0; 11 | } -------------------------------------------------------------------------------- /tlpi-dist/shlibs/Demo_static_lib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Build a program using a static library 3 | # 4 | 5 | cc -g -c mod1.c mod2.c mod3.c 6 | ar r libdemo.a mod1.o mod2.o mod3.o 7 | 8 | cc -g -o prog_static prog.c libdemo.a 9 | # Or: cc -g -o prog_static prog.c -L. -ldemo 10 | -------------------------------------------------------------------------------- /Exercise/30_2/Makefile: -------------------------------------------------------------------------------- 1 | CC = cc 2 | CFLAGS = -g -Wall -pthread 3 | 4 | OBJ = test.o tsb_tree.o 5 | 6 | all: test 7 | 8 | tsb_tree.o: tsb_tree.c tsb_tree.h 9 | test.o: test.c tsb_tree.h 10 | 11 | test: $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o test 13 | 14 | clean: 15 | rm -fv *.o test 16 | -------------------------------------------------------------------------------- /Exercise/47/47_5/event_flag.h: -------------------------------------------------------------------------------- 1 | #ifndef EVENT_FLAG_H 2 | #define EVENT_FLAG_H 3 | 4 | int setEventFlag(int semId, int semNum); 5 | 6 | int clearEventFlag(int semId, int semNum); 7 | 8 | int waitForEventFlag(int semId, int semNum); 9 | 10 | int getFlagState(int semId, int semNum); 11 | 12 | #endif -------------------------------------------------------------------------------- /Exercise/42/mod1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void __attribute__((constructor)) mod1_load(void) 4 | { 5 | printf("mod1: load\n"); 6 | } 7 | 8 | void __attribute__((destructor)) mod1_unload(void) 9 | { 10 | printf("mod1: unload\n"); 11 | } 12 | 13 | void mod1() 14 | { 15 | printf("mod1\n"); 16 | } 17 | -------------------------------------------------------------------------------- /Exercise/48/48_3/Makefile: -------------------------------------------------------------------------------- 1 | TLPI_LIB = /usr/local/lib/libtlpi.a 2 | GEN_EXE = svshm_xfr_writer svshm_xfr_reader 3 | 4 | svshm_xfr_writer.o svshm_xfr_reader.o : svshm_xfr.h 5 | 6 | all: ${GEN_EXE} 7 | 8 | clean: 9 | ${RM} ${GEN_EXE} *.o 10 | 11 | showall: 12 | @ echo ${GEN_EXE} 13 | 14 | ${GEN_EXE} : ${TLPI_LIB} 15 | -------------------------------------------------------------------------------- /Exercise/46_2/Makefile: -------------------------------------------------------------------------------- 1 | TLPI_LIB = /usr/local/lib/libtlpi.a 2 | GEN_EXE = msg_seqnum_client msg_seqnum_server 3 | 4 | msg_seqnum_client.o msg_seqnum_server.o : msg_seqnum.h 5 | 6 | all: ${GEN_EXE} 7 | 8 | clean: 9 | ${RM} ${GEN_EXE} *.o 10 | 11 | showall: 12 | @ echo ${GEN_EXE} 13 | 14 | ${GEN_EXE} : ${TLPI_LIB} 15 | -------------------------------------------------------------------------------- /Exercise/46_45/Makefile: -------------------------------------------------------------------------------- 1 | TLPI_LIB = /usr/local/lib/libtlpi.a 2 | GEN_EXE = svmsg_file_client svmsg_file_server 3 | 4 | svmsg_file_client.o svmsg_file_server.o : svmsg_file.h 5 | 6 | all: ${GEN_EXE} 7 | 8 | clean: 9 | ${RM} ${GEN_EXE} *.o 10 | 11 | showall: 12 | @ echo ${GEN_EXE} 13 | 14 | ${GEN_EXE} : ${TLPI_LIB} 15 | -------------------------------------------------------------------------------- /Exercise/53/53_2/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | sem_t *sem; 8 | 9 | sem = sem_open("/aaa", O_CREAT | O_EXCL | O_RDWR, 0666, 1); // 对于信号量默认是读写不是只读 10 | if (sem == SEM_FAILED) 11 | errExit("sem_open"); 12 | 13 | return 0; 14 | } -------------------------------------------------------------------------------- /Exercise/61/5/shell_h.h: -------------------------------------------------------------------------------- 1 | #ifndef SHELL_H_H 2 | #define SHELL_H_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define PORT_NUMBER 9990 9 | #define HOST_ADDRESS "127.0.0.1" 10 | #define MAXLINE 1024 11 | 12 | int pr_sockname_inet4(int sfd, struct sockaddr_in *addr); 13 | 14 | #endif -------------------------------------------------------------------------------- /Exercise/46_0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct a 5 | { 6 | long a; 7 | int b; 8 | long c; 9 | }; 10 | 11 | int main() 12 | { 13 | printf("%ld\n", (long)offsetof(struct a, c) - (long)offsetof(struct a, b) + 8); 14 | printf("%ld\n", sizeof(struct a) - 8); 15 | 16 | return 0; 17 | } -------------------------------------------------------------------------------- /Exercise/46_6/Makefile: -------------------------------------------------------------------------------- 1 | TLPI_LIB = /usr/local/lib/libtlpi.a 2 | GEN_EXE = fifo_seqnum_client fifo_seqnum_server 3 | 4 | fifo_seqnum_client.o fifo_seqnum_server.o : fifo_seqnum.h 5 | 6 | all: ${GEN_EXE} 7 | 8 | clean: 9 | ${RM} ${GEN_EXE} *.o 10 | 11 | showall: 12 | @ echo ${GEN_EXE} 13 | 14 | ${GEN_EXE} : ${TLPI_LIB} 15 | -------------------------------------------------------------------------------- /Exercise/61/5/shell_h.c: -------------------------------------------------------------------------------- 1 | #include "shell_h.h" 2 | 3 | int pr_sockname_inet4(int sfd, struct sockaddr_in *addr) 4 | { 5 | char addrstr[INET_ADDRSTRLEN]; 6 | if (inet_ntop(AF_INET, &addr->sin_addr, addrstr, sizeof(addrstr)) == NULL) 7 | return -1; 8 | printf("%s : %u\n", addrstr, ntohs(addr->sin_port)); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /Exercise/44_3456/Makefile: -------------------------------------------------------------------------------- 1 | TLPI_LIB = /usr/local/lib/libtlpi.a 2 | GEN_EXE = fifo_seqnum_client fifo_seqnum_server 3 | 4 | fifo_seqnum_client.o fifo_seqnum_server.o : fifo_seqnum.h 5 | 6 | all: ${GEN_EXE} 7 | 8 | clean: 9 | ${RM} ${GEN_EXE} *.o 10 | 11 | showall: 12 | @ echo ${GEN_EXE} 13 | 14 | ${GEN_EXE} : ${TLPI_LIB} 15 | -------------------------------------------------------------------------------- /tlpi-dist/filelock/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = i_fcntl_locking t_flock 4 | 5 | EXE = ${GEN_EXE} ${LINUX_EXE} 6 | 7 | all : ${EXE} 8 | 9 | allgen : ${GEN_EXE} 10 | 11 | clean : 12 | ${RM} ${EXE} *.o 13 | 14 | showall : 15 | @ echo ${EXE} 16 | 17 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 18 | -------------------------------------------------------------------------------- /Exercise/59/1/ind.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "my_read_line_buf.h" 6 | 7 | #define PORT_NUM "50000" /* Port number for server */ 8 | 9 | #define INT_LEN 30 /* Size of string able to hold largest \ 10 | integer (including terminating '\n') */ 11 | -------------------------------------------------------------------------------- /Exercise/62/3/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "mygetpass.h" 5 | 6 | int main() 7 | { 8 | char *p_pass = mygetpass("Password: "); // 注意剥离了最后\n字符,并以NULL结尾 9 | if (!p_pass) 10 | errExit("getpass"); 11 | else 12 | printf("%s\n", p_pass); 13 | sleep(5); 14 | 15 | return 0; 16 | } -------------------------------------------------------------------------------- /tlpi-dist/proccred/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = 4 | 5 | LINUX_EXE = idshow 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/getopt/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = t_getopt 4 | 5 | LINUX_EXE = 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/pty/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = script unbuffer 4 | 5 | LINUX_EXE = 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/memalloc/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = free_and_sbrk 4 | 5 | LINUX_EXE = 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/progconc/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = syscall_speed 4 | 5 | LINUX_EXE = 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/daemons/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = daemon_SIGHUP t_syslog test_become_daemon 4 | 5 | EXE = ${GEN_EXE} ${LINUX_EXE} 6 | 7 | all : ${EXE} 8 | 9 | allgen : ${GEN_EXE} 10 | 11 | clean : 12 | ${RM} ${EXE} *.o 13 | 14 | showall : 15 | @ echo ${EXE} 16 | 17 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 18 | -------------------------------------------------------------------------------- /tlpi-dist/syslim/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = t_fpathconf t_sysconf 4 | 5 | LINUX_EXE = 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/xattr/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = 4 | 5 | LINUX_EXE = t_setxattr xattr_view 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /Exercise/24_3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | pid_t pid = fork(); 7 | switch (pid) 8 | { 9 | case -1: 10 | errExit("fork"); 11 | 12 | case 0: 13 | raise(SIGABRT); 14 | errExit("raise"); 15 | 16 | default: 17 | break; 18 | } 19 | 20 | return 0; 21 | } -------------------------------------------------------------------------------- /tlpi-dist/svipc/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = svmsg_demo_server t_ftok 4 | 5 | LINUX_EXE = 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/tty/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = demo_SIGWINCH new_intr no_echo test_tty_functions 4 | 5 | EXE = ${GEN_EXE} ${LINUX_EXE} 6 | 7 | all : ${EXE} 8 | 9 | allgen : ${GEN_EXE} 10 | 11 | clean : 12 | ${RM} ${EXE} *.o 13 | 14 | showall : 15 | @ echo ${EXE} 16 | 17 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 18 | -------------------------------------------------------------------------------- /Exercise/42/mod2.c: -------------------------------------------------------------------------------- 1 | // mod2 依赖 mod1 2 | 3 | #include 4 | 5 | void mod1(); 6 | 7 | void __attribute__((constructor)) mod2_load(void) 8 | { 9 | printf("mod2: load\n"); 10 | } 11 | 12 | void __attribute__((destructor)) mod2_unload(void) 13 | { 14 | printf("mod2: unload\n"); 15 | } 16 | 17 | void mod2() 18 | { 19 | printf("mod2\n"); 20 | mod1(); 21 | } -------------------------------------------------------------------------------- /tlpi-dist/procres/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = rusage rusage_wait 4 | 5 | LINUX_EXE = rlimit_nproc 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /Exercise/31_2/ts_dirname.h: -------------------------------------------------------------------------------- 1 | /* Use thread-specific data to implement dirname and basename's thread-safe version */ 2 | 3 | #ifndef TS_DIRNAME_H 4 | #define TS_DIRNAME_H 5 | 6 | // thread-safe by using thread specific data 7 | char *ts_dirname(char *pathname); 8 | 9 | // thread-safe by using thread local stroge 10 | char *tls_dirname(char *pathname); 11 | 12 | #endif -------------------------------------------------------------------------------- /tlpi-dist/filesys/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = t_statvfs 4 | 5 | LINUX_EXE = t_statfs t_mount t_umount 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/sysinfo/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = t_uname 4 | 5 | LINUX_EXE = procfs_pidmax procfs_user_exe 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/vmem/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = memlock madvise_dontneed 4 | 5 | LINUX_EXE = t_mprotect 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/loginacct/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = 4 | 5 | LINUX_EXE = dump_utmpx utmpx_login view_lastlog 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/files/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = t_chown t_stat t_umask t_utime t_utimes 4 | 5 | LINUX_EXE = chiflag 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /tlpi-dist/mmap/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = anon_mmap mmcat mmcopy t_mmap 4 | 5 | LINUX_EXE = t_remap_file_pages 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /Exercise/57/3/myund.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define SOCKET_PATH "mysocket" 6 | 7 | struct request 8 | { /* Request (client --> server) */ 9 | int seqLen; /* Length of desired sequence */ 10 | }; 11 | 12 | struct response 13 | { /* Response (server --> client) */ 14 | int seqNum; /* Start of sequence */ 15 | }; 16 | -------------------------------------------------------------------------------- /Exercise/3_1.c: -------------------------------------------------------------------------------- 1 | // It works fine 2 | // #include 3 | // #include 4 | 5 | // int main() 6 | // { 7 | // reboot(RB_AUTOBOOT); 8 | // return 0; 9 | // } 10 | 11 | // It works well too. 12 | #include 13 | #include 14 | 15 | int reboot(int); 16 | int main() 17 | { 18 | reboot(LINUX_REBOOT_CMD_RESTART); 19 | return 0; 20 | } -------------------------------------------------------------------------------- /tlpi-dist/pgsjc/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = catch_SIGHUP disc_SIGHUP job_mon \ 4 | orphaned_pgrp_SIGHUP handling_SIGTSTP t_setsid 5 | 6 | EXE = ${GEN_EXE} ${LINUX_EXE} 7 | 8 | all : ${EXE} 9 | 10 | allgen : ${GEN_EXE} 11 | 12 | clean : 13 | ${RM} ${EXE} *.o 14 | 15 | showall : 16 | @ echo ${EXE} 17 | 18 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 19 | -------------------------------------------------------------------------------- /tlpi-dist/Makefile.inc.MacOSX: -------------------------------------------------------------------------------- 1 | # Makefile.inc - common definitions used by all makefiles 2 | # Mac OS (Lion) version 3 | 4 | TLPI_DIR = .. 5 | TLPI_LIB = ${TLPI_DIR}/libtlpi.a 6 | TLPI_INCL_DIR = ${TLPI_DIR}/lib 7 | 8 | IMPL_CFLAGS += -g -I${TLPI_INCL_DIR} 9 | CFLAGS = ${IMPL_CFLAGS} 10 | IMPL_THREAD_FLAGS = 11 | 12 | IMPL_LDLIBS = ${TLPI_LIB} -lm 13 | LDLIBS = ${IMPL_LDLIBS} 14 | 15 | RM = rm -f 16 | -------------------------------------------------------------------------------- /tlpi-dist/shlibs/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = dynload 4 | 5 | LINUX_EXE = 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | dynload : dynload.o 14 | ${CC} -o $@ dynload.o ${CFLAGS} ${IMPL_LDLIBS} ${LINUX_LIBDL} 15 | 16 | clean : 17 | ${RM} ${EXE} *.o *.so.* 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /Exercise/45_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | struct stat buf; 8 | key_t key = ftok("45_1", 2); 9 | printf("%08x\n", (int)key); 10 | stat("45_1", &buf); 11 | printf("%02x\n", 2 & 0xff); 12 | printf("%02x\n", (int)buf.st_dev & 0xff); 13 | printf("%04x\n", (int)buf.st_ino & 0xffff); 14 | 15 | return 0; 16 | } -------------------------------------------------------------------------------- /tlpi-dist/inotify/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = 4 | 5 | LINUX_EXE = demo_inotify dnotify inotify_dtree rand_dtree 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allftw : ${FTW_EXE} 12 | 13 | allgen : ${GEN_EXE} 14 | 15 | clean : 16 | ${RM} ${EXE} *.o 17 | 18 | showall : 19 | @ echo ${EXE} 20 | 21 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 22 | -------------------------------------------------------------------------------- /tlpi-dist/svsem/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = svsem_create svsem_demo svsem_mon svsem_op svsem_rm svsem_setall 4 | 5 | LINUX_EXE = svsem_info 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | -------------------------------------------------------------------------------- /Exercise/26_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | pid_t pid = fork(); 7 | switch (pid) 8 | { 9 | case -1: 10 | errExit("fork"); 11 | 12 | case 0: 13 | sleep(2); 14 | printf("%ld\n", (long)getppid()); 15 | _exit(EXIT_FAILURE); 16 | 17 | default: 18 | exit(EXIT_SUCCESS); 19 | } 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /tlpi-dist/Makefile.inc.FreeBSD: -------------------------------------------------------------------------------- 1 | # Makefile.inc - common definitions used by all makefiles 2 | # FreeBSD version 3 | 4 | TLPI_DIR = .. 5 | TLPI_LIB = ${TLPI_DIR}/libtlpi.a 6 | TLPI_INCL_DIR = ${TLPI_DIR}/lib 7 | 8 | IMPL_CFLAGS += -g -I${TLPI_INCL_DIR} 9 | CFLAGS = ${IMPL_CFLAGS} 10 | IMPL_THREAD_FLAGS = -pthread 11 | 12 | IMPL_LDLIBS = ${TLPI_LIB} -lcrypt -lm 13 | LDLIBS = ${IMPL_LDLIBS} 14 | 15 | RM = rm -f 16 | -------------------------------------------------------------------------------- /Exercise/52/52_6/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | mqd_t mqd; 6 | if ((mqd = mq_open("/a", O_CREAT | O_EXCL | O_WRONLY, 0666, NULL)) == -1) 7 | errExit("mq_open"); 8 | 9 | sleep(10); 10 | 11 | for (;;) 12 | { 13 | sleep(1); 14 | if (mq_send(mqd, "a", 1, 0) == -1) 15 | errExit("mq_send"); 16 | } 17 | 18 | return 0; 19 | } -------------------------------------------------------------------------------- /Exercise/8_2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct passwd *my_getpwnam(const char *name) 5 | { 6 | struct passwd *pwd; 7 | while ((pwd = getpwent()) != NULL) 8 | if (strcmp(pwd->pw_name, name) == 0) 9 | break; 10 | endpwent(); 11 | return pwd; 12 | } 13 | 14 | int main() 15 | { 16 | printf("%ld\n", (long)my_getpwnam("water")->pw_uid); 17 | 18 | return 0; 19 | } -------------------------------------------------------------------------------- /tlpi-dist/proc/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = bad_longjmp display_env longjmp \ 4 | necho setjmp_vars setjmp_vars_opt t_getenv 5 | 6 | LINUX_EXE = modify_env 7 | 8 | EXE = ${GEN_EXE} ${LINUX_EXE} 9 | 10 | all : ${EXE} 11 | 12 | allgen : ${GEN_EXE} 13 | 14 | clean : 15 | ${RM} ${EXE} *.o 16 | 17 | showall : 18 | @ echo ${EXE} 19 | 20 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 21 | -------------------------------------------------------------------------------- /Exercise/25_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int status; 7 | pid_t pid = fork(); 8 | switch (pid) 9 | { 10 | case -1: 11 | errExit("fork"); 12 | 13 | case 0: 14 | exit(-1); 15 | 16 | default: 17 | wait(&status); 18 | } 19 | 20 | if (WIFEXITED(status)) 21 | printf("%d\n", WEXITSTATUS(status)); 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /Exercise/59/1/my_read_line_buf.h: -------------------------------------------------------------------------------- 1 | #ifndef READ_LINE_BUF_H 2 | #define READ_LINE_BUF_H 3 | 4 | #include 5 | #include 6 | 7 | #define MAX_RLBUF 8192 8 | 9 | struct rlbuf 10 | { 11 | int len; 12 | int next; 13 | int fd; 14 | char buf[MAX_RLBUF]; 15 | }; 16 | 17 | void myreadLineBufInit(int fd, struct rlbuf *rlbuf); 18 | 19 | ssize_t myreadLineBuf(struct rlbuf *rlbuf, char *buffer, size_t n); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /tlpi-dist/fileio/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = atomic_append bad_exclusive_open copy \ 4 | multi_descriptors seek_io t_readv t_truncate 5 | 6 | LINUX_EXE = large_file 7 | 8 | EXE = ${GEN_EXE} ${LINUX_EXE} 9 | 10 | all : ${EXE} 11 | 12 | allgen : ${GEN_EXE} 13 | 14 | 15 | clean : 16 | ${RM} ${EXE} *.o 17 | 18 | showall : 19 | @ echo ${EXE} 20 | 21 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 22 | -------------------------------------------------------------------------------- /Exercise/52/52_1/mq_write.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int mqd; 7 | 8 | mqd = mq_open("/aaa", O_CREAT | O_EXCL | O_RDWR, 0666, NULL); 9 | if (mqd == (mqd_t)-1) 10 | errExit("mq_open"); 11 | 12 | sleep(20); 13 | 14 | if (mq_send(mqd, "aaa", 3, 0) == -1) 15 | errExit("mq_send"); 16 | 17 | mq_close(mqd); 18 | mq_unlink("/aaa"); 19 | return 0; 20 | } -------------------------------------------------------------------------------- /Exercise/59/2/ind.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "../../../tlpi-dist/lib/inet_sockets.h" 6 | #include "../../../tlpi-dist/sockets/read_line.h" /* Declaration of readLine() */ 7 | 8 | #define PORT_NUM "50000" /* Port number for server */ 9 | 10 | #define INT_LEN 30 /* Size of string able to hold largest \ 11 | integer (including terminating '\n') */ 12 | -------------------------------------------------------------------------------- /tlpi-dist/cgroups/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = alloc_mem fork_bomb 4 | 5 | EXE = ${GEN_EXE} ${LINUX_EXE} 6 | 7 | all : ${EXE} 8 | 9 | allgen : ${GEN_EXE} 10 | 11 | clean : 12 | ${RM} ${EXE} *.o 13 | 14 | showall : 15 | @ echo ${EXE} 16 | 17 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 18 | 19 | alloc_mem: alloc_mem.o 20 | ${CC} -o $@ alloc_mem.o \ 21 | ${CFLAGS} ${IMPL_LDLIBS} ${IMPL_THREAD_FLAGS} 22 | -------------------------------------------------------------------------------- /Exercise/52/52_5/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | mqd_t mqd; 6 | if ((mqd = mq_open("/a", O_CREAT | O_EXCL | O_WRONLY, 0666, NULL)) == -1) 7 | errExit("mq_open"); 8 | 9 | sleep(10); 10 | printf("a\n"); 11 | 12 | for (;;) 13 | { 14 | sleep(3); 15 | if (mq_send(mqd, "a", 1, 0) == -1) 16 | errExit("mq_send"); 17 | } 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /tlpi-dist/dirs_links/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = bad_symlink file_type_stats list_files list_files_readdir_r \ 4 | nftw_dir_tree t_dirbasename t_unlink view_symlink 5 | 6 | LINUX_EXE = 7 | 8 | EXE = ${GEN_EXE} ${LINUX_EXE} 9 | 10 | all : ${EXE} 11 | 12 | allgen : ${GEN_EXE} 13 | 14 | clean : 15 | ${RM} ${EXE} *.o 16 | 17 | showall : 18 | @ echo ${EXE} 19 | 20 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 21 | -------------------------------------------------------------------------------- /tlpi-dist/Makefile.inc.Tru64: -------------------------------------------------------------------------------- 1 | # Makefile.inc - common definitions used by all makefiles 2 | # Tru64 version 3 | 4 | TLPI_DIR = .. 5 | TLPI_LIB = ${TLPI_DIR}/libtlpi.a 6 | TLPI_INCL_DIR = ${TLPI_DIR}/lib 7 | 8 | IMPL_CFLAGS = -g -I${TLPI_INCL_DIR} -D_POSIX_PII_SOCKET -D_OSF_SOURCE 9 | CFLAGS = ${IMPL_CFLAGS} 10 | IMPL_THREAD_FLAGS = -pthread 11 | 12 | IMPL_LDLIBS = ${TLPI_LIB} -lrt -lm 13 | LOADLIBES = ${IMPL_LDLIBS} 14 | LDLIBS = ${IMPL_LDLIBS} 15 | 16 | RM = rm -f 17 | -------------------------------------------------------------------------------- /tlpi-dist/pipes/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = change_case fifo_seqnum_client fifo_seqnum_server \ 4 | pipe_ls_wc pipe_sync popen_glob simple_pipe 5 | 6 | EXE = ${GEN_EXE} ${LINUX_EXE} 7 | 8 | all : ${EXE} 9 | 10 | allgen : ${GEN_EXE} 11 | 12 | fifo_seqnum_client.o fifo_seqnum_server.o : fifo_seqnum.h 13 | 14 | clean : 15 | ${RM} ${EXE} *.o 16 | 17 | showall : 18 | @ echo ${EXE} 19 | 20 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 21 | -------------------------------------------------------------------------------- /tlpi-dist/acl/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = 4 | 5 | LINUX_EXE = acl_update acl_view 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | LDLIBS = ${IMPL_LDLIBS} ${LINUX_LIBACL} 14 | # All of the programs in this directory need the 15 | # ACL library, libacl. 16 | 17 | clean : 18 | ${RM} ${EXE} *.o 19 | 20 | showall : 21 | @ echo ${EXE} 22 | 23 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 24 | -------------------------------------------------------------------------------- /tlpi-dist/procpri/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = sched_set sched_view t_setpriority 4 | 5 | LINUX_EXE = demo_sched_fifo t_sched_setaffinity t_sched_getaffinity 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | LDLIBS = ${IMPL_LDLIBS} #CF[ ${LINUX_LIBRT} ] 10 | 11 | all : ${EXE} 12 | 13 | allgen : ${GEN_EXE} 14 | 15 | clean : 16 | ${RM} ${EXE} *.o 17 | 18 | showall : 19 | @ echo ${EXE} 20 | 21 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 22 | -------------------------------------------------------------------------------- /Exercise/20_2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | struct sigaction act; 9 | sigemptyset(&act.sa_mask); 10 | act.sa_handler = SIG_IGN; 11 | act.sa_flags = 0; 12 | 13 | if (sigaction(SIGTERM, &act, NULL) == -1) 14 | { 15 | printf("sigaction failed\n"); 16 | exit(EXIT_FAILURE); 17 | } 18 | 19 | while (1) 20 | { 21 | pause(); 22 | } 23 | 24 | return 0; 25 | } -------------------------------------------------------------------------------- /tlpi-dist/Makefile.inc.Solaris: -------------------------------------------------------------------------------- 1 | # Makefile.inc - common definitions used by all makefiles 2 | # Solaris version 3 | 4 | TLPI_DIR = .. 5 | TLPI_LIB = ${TLPI_DIR}/libtlpi.a 6 | TLPI_INCL_DIR = ${TLPI_DIR}/lib 7 | 8 | IMPL_CFLAGS += -g -I${TLPI_INCL_DIR} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -D_XPG4_2 -D_POSIX_C_SOURCE=199506 9 | CFLAGS = ${IMPL_CFLAGS} 10 | IMPL_THREAD_FLAGS = -mt 11 | 12 | IMPL_LDLIBS = ${TLPI_LIB} -lsocket -lnsl -lrt -ldl -lm -lresolv 13 | LDLIBS = ${IMPL_LDLIBS} 14 | 15 | RM = rm -f 16 | -------------------------------------------------------------------------------- /tlpi-dist/lib/README: -------------------------------------------------------------------------------- 1 | A small design note... Many of the library functions defined in the 2 | source code modules in this directory handle errors from system calls 3 | and C library functions by simply terminating the process. This 4 | isn't acceptable design for a "real world" suite of library functions; 5 | I did things this way to keep the source code simpler and shorter. 6 | A properly designed function should indicate an error to its caller 7 | using a status argument or some special function return value. 8 | -------------------------------------------------------------------------------- /tlpi-dist/users_groups/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = t_getpwent t_getpwnam_r 4 | 5 | LINUX_EXE = check_password idshow 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | check_password : check_password.o 17 | ${CC} -o $@ check_password.o ${LDFLAGS} ${IMPL_LDLIBS} ${LINUX_LIBCRYPT} 18 | 19 | showall : 20 | @ echo ${EXE} 21 | 22 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 23 | -------------------------------------------------------------------------------- /Exercise/47/47_3b.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "tlpi_hdr.h" 5 | #include "semun.h" 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | int semid = atoi(argv[1]); 10 | struct sembuf sop; 11 | 12 | sop.sem_flg = 0; 13 | sop.sem_num = 0; 14 | sop.sem_op = 1; 15 | if (semop(semid, &sop, 1) == -1) 16 | errExit("semop"); 17 | sleep(20); 18 | printf("b SEMPID: %d\n", semctl(semid, 0, GETPID)); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /tlpi-dist/svshm/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = svshm_attach svshm_create svshm_mon svshm_rm \ 4 | svshm_xfr_reader svshm_xfr_writer 5 | 6 | LINUX_EXE = svshm_info svshm_lock svshm_unlock 7 | 8 | EXE = ${GEN_EXE} ${LINUX_EXE} 9 | 10 | all : ${EXE} 11 | 12 | allgen : ${GEN_EXE} 13 | 14 | clean : 15 | ${RM} ${EXE} *.o 16 | 17 | svshm_xfr_reader.o svshm_xfr_writer.o: svshm_xfr.h 18 | 19 | showall : 20 | @ echo ${EXE} 21 | 22 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 23 | -------------------------------------------------------------------------------- /tlpi-dist/pshm/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = pshm_create pshm_read pshm_write pshm_unlink 4 | 5 | LINUX_EXE = 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | LDLIBS = ${IMPL_LDLIBS} ${LINUX_LIBRT} 14 | # All of the programs in this directory need the 15 | # realtime library, librt. 16 | 17 | 18 | clean : 19 | ${RM} ${EXE} *.o 20 | 21 | showall : 22 | @ echo ${EXE} 23 | 24 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 25 | -------------------------------------------------------------------------------- /tlpi-dist/svmsg/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = svmsg_chqbytes svmsg_file_client svmsg_file_server \ 4 | svmsg_create svmsg_receive svmsg_rm svmsg_send 5 | 6 | LINUX_EXE = svmsg_info svmsg_ls 7 | 8 | EXE = ${GEN_EXE} ${LINUX_EXE} 9 | 10 | all : ${EXE} 11 | 12 | allgen : ${GEN_EXE} 13 | 14 | clean : 15 | ${RM} ${EXE} *.o 16 | 17 | svmsg_file_client.o svmsg_file_server.o : svmsg_file.h 18 | 19 | showall : 20 | @ echo ${EXE} 21 | 22 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 23 | -------------------------------------------------------------------------------- /Exercise/50/2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | void *addr; 7 | if ((addr = mmap(NULL, 4096, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0)) == MAP_FAILED) 8 | errExit("mmap"); 9 | *(int *)addr = 1; 10 | printf("before %d\n", *(int *)addr); 11 | if (madvise(addr, 4096, MADV_DONTNEED) == -1) 12 | errExit("madvise"); 13 | printf("after %d\n", *(int *)addr); 14 | // MAP_PRIVATE的情况下,丢弃后在内存分页中现在的值重新初始化 15 | // MAP_SHARED可能会丢弃,这个取决于平台,不具有移植性,可能不会丢弃 16 | 17 | return 0; 18 | } -------------------------------------------------------------------------------- /Exercise/20_3b.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void handler(int sig) 5 | { 6 | printf("a\n"); 7 | sleep(3); 8 | printf("b\n"); 9 | } 10 | 11 | int main() 12 | { 13 | struct sigaction act; 14 | 15 | sigemptyset(&act.sa_mask); 16 | act.sa_flags = SA_NODEFER; 17 | // act.sa_flags = 0; 18 | act.sa_handler = handler; 19 | if (sigaction(SIGTERM, &act, NULL) == -1) 20 | errExit("sigaction"); 21 | 22 | while (1) 23 | { 24 | pause(); 25 | } 26 | 27 | return 0; 28 | } -------------------------------------------------------------------------------- /Exercise/29_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "tlpi_hdr.h" 3 | 4 | void *pthread_func(void *arg) 5 | { 6 | printf("aaa"); 7 | } 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | pthread_t t1; 12 | int s; 13 | 14 | s = pthread_create(&t1, NULL, pthread_func, NULL); 15 | if (s != 0) 16 | printf("pthread_create failed\n"); 17 | 18 | s = pthread_join(pthread_self(), NULL); 19 | if (s != 0) 20 | { 21 | printf("%s\n", strerror(s)); 22 | errExitEN(s, ""); 23 | } 24 | 25 | return 0; 26 | } -------------------------------------------------------------------------------- /Exercise/20_3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void handler(int sig) 5 | { 6 | printf("caught a signal %d\n", sig); 7 | } 8 | 9 | int main() 10 | { 11 | struct sigaction act; 12 | 13 | sigemptyset(&act.sa_mask); 14 | act.sa_flags = SA_RESETHAND; 15 | // act.sa_handler = SIG_IGN; // sa_handler is a macro 16 | act.sa_handler = handler; 17 | if (sigaction(SIGTERM, &act, NULL) == -1) 18 | errExit("sigaction"); 19 | 20 | while (1) 21 | { 22 | pause(); 23 | } 24 | 25 | return 0; 26 | } -------------------------------------------------------------------------------- /Exercise/24_2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | pid_t pid = vfork(); 8 | switch (pid) 9 | { 10 | case -1: 11 | errExit("vfork"); 12 | 13 | case 0: 14 | if (close(STDIN_FILENO) == -1) 15 | errExit("close"); 16 | assert(write(STDIN_FILENO, "c\n", 2) == -1); 17 | _exit(EXIT_SUCCESS); 18 | 19 | default: 20 | if (write(STDIN_FILENO, "p\n", 2) != 2) 21 | errExit("write"); 22 | exit(EXIT_SUCCESS); 23 | } 24 | } -------------------------------------------------------------------------------- /Exercise/62/2/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "myttyname.h" 4 | 5 | /* The function ttyname() returns a pointer to a pathname on success. 6 | * On error, NULL is returned, and errno is set appropriately. 7 | */ 8 | 9 | int main() 10 | { 11 | char *str = my_ttyname(STDIN_FILENO); 12 | if (str == NULL) 13 | errExit("ttyname"); 14 | printf("%s\n", str); 15 | printf("------------------\n"); 16 | str = ttyname(STDIN_FILENO); 17 | if (str == NULL) 18 | errExit("ttyname"); 19 | printf("%s\n", str); 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /Exercise/34/6/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | pid_t pid; 8 | char buf[10]; 9 | 10 | pid = fork(); 11 | switch (pid) 12 | { 13 | case -1: 14 | errExit("fork"); 15 | break; 16 | 17 | case 0: 18 | sleep(2); // 确保成为孤儿进程组 19 | if (read(STDIN_FILENO, buf, 10) < 0) 20 | { 21 | if (errno == EIO) 22 | printf("孤儿进程组read会出现EIO错误\n"); 23 | else 24 | errExit("read"); 25 | } 26 | _exit(EXIT_SUCCESS); 27 | break; 28 | 29 | default: 30 | break; 31 | } 32 | return 0; 33 | } -------------------------------------------------------------------------------- /tlpi-dist/time/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = calendar_time show_time process_time strtime 4 | 5 | EXE = ${GEN_EXE} ${LINUX_EXE} 6 | 7 | all : ${EXE} 8 | 9 | allgen : ${GEN_EXE} 10 | 11 | clean : 12 | ${RM} ${EXE} *.o 13 | 14 | showall : 15 | @ echo ${EXE} 16 | 17 | cal_time: cal_time.o 18 | ${CC} -o $@ cal_time.o ${CFLAGS} ${IMPL_LDLIBS} ${LINUX_LIBRT} 19 | 20 | process_time_test: process_time_test.o 21 | ${CC} -o $@ process_time_test.o ${CFLAGS} ${IMPL_LDLIBS} ${LINUX_LIBRT} 22 | 23 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 24 | -------------------------------------------------------------------------------- /Exercise/55/3/b.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | int fd; 8 | 9 | if ((fd = open("./file", O_RDONLY)) == -1) 10 | errExit("open"); 11 | 12 | if (flock(fd, LOCK_EX) == -1) 13 | { 14 | if (errno == EWOULDBLOCK) 15 | printf("already locked"); 16 | else 17 | errExit("flock"); 18 | } 19 | else 20 | printf("PID: %ld 获取 flock 互斥锁\n", (long)getpid()); 21 | 22 | if (flock(fd, LOCK_UN) == -1) 23 | errExit("flock"); 24 | printf("PID: %ld 释放 flock 互斥锁\n", (long)getpid()); 25 | 26 | return 0; 27 | } -------------------------------------------------------------------------------- /Exercise/59/4/header/kv.h: -------------------------------------------------------------------------------- 1 | #ifndef KV_H 2 | #define KV_H 3 | 4 | /* 5 | * key-value we use string-string as follows 6 | * apple : pingguo 7 | * banana : xiangjiao 8 | * canada : jianada 9 | */ 10 | 11 | #define MAXBUF 32 12 | typedef struct kv_dsa kv_dsa; 13 | struct kv_dsa 14 | { 15 | char key[MAXBUF]; 16 | char value[MAXBUF]; 17 | kv_dsa *next; 18 | }; 19 | 20 | kv_dsa *init_kv(); 21 | 22 | int add_kv(kv_dsa *kv, char *key, char *value); 23 | 24 | int delete_kv(kv_dsa *kv, char *key); 25 | 26 | int change_kv(kv_dsa *kv, char *key, char *value); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /tlpi-dist/Makefile.inc.HP-UX: -------------------------------------------------------------------------------- 1 | # Makefile.inc - common definitions used by all makefiles 2 | # HP-UX Version 3 | 4 | TLPI_DIR = .. 5 | TLPI_LIB = ${TLPI_DIR}/libtlpi.a 6 | TLPI_INCL_DIR = ${TLPI_DIR}/lib 7 | 8 | LINUX_LIBRT = -lrt 9 | LINUX_LIBDL = -ldl 10 | LINUX_LIBACL = -lacl 11 | LINUX_LIBCRYPT = -lcrypt 12 | LINUX_LIBCAP = -lcap 13 | 14 | IMPL_CFLAGS = -g -I${TLPI_INCL_DIR} -D_XOPEN_SOURCE_EXTENDED 15 | CFLAGS = ${IMPL_CFLAGS} 16 | IMPL_THREAD_FLAGS = -mt 17 | 18 | IMPL_LDLIBS = ${TLPI_LIB} -lm 19 | LDFLAGS = ${IMPL_LDLIBS} 20 | LDLIBS = ${IMPL_LDLIBS} 21 | 22 | RM = rm -f 23 | -------------------------------------------------------------------------------- /Exercise/49/49_2/a.txt: -------------------------------------------------------------------------------- 1 | asdfa 2 | asdfadffasdfasdf 3 | asdfadffasdfasdf 4 | afsdgag 5 | tuewhed 6 | dffasdfasdf 7 | asdfa 8 | asdfadffasdfasdf 9 | asdfadffasdfasdf 10 | afsdgag 11 | tuewhed 12 | dffasdfasdf 13 | asdfa 14 | asdfadffasdfasdf 15 | asdfadffasdfasdf 16 | afsdgag 17 | tuewhed 18 | dffasdfasdf 19 | asdfa 20 | asdfadffasdfasdf 21 | asdfadffasdfasdf 22 | afsdgag 23 | tuewhed 24 | dffasdfasdf 25 | asdfa 26 | asdfadffasdfasdf 27 | asdfadffasdfasdf 28 | afsdgag 29 | tuewhed 30 | dffasdfasdf 31 | asdfa 32 | asdfadffasdfasdf 33 | asdfadffasdfasdf 34 | afsdgag 35 | tuewhed 36 | dffasdfasdf -------------------------------------------------------------------------------- /Exercise/49/49_2/b.txt: -------------------------------------------------------------------------------- 1 | asdfa 2 | asdfadffasdfasdf 3 | asdfadffasdfasdf 4 | afsdgag 5 | tuewhed 6 | dffasdfasdf 7 | asdfa 8 | asdfadffasdfasdf 9 | asdfadffasdfasdf 10 | afsdgag 11 | tuewhed 12 | dffasdfasdf 13 | asdfa 14 | asdfadffasdfasdf 15 | asdfadffasdfasdf 16 | afsdgag 17 | tuewhed 18 | dffasdfasdf 19 | asdfa 20 | asdfadffasdfasdf 21 | asdfadffasdfasdf 22 | afsdgag 23 | tuewhed 24 | dffasdfasdf 25 | asdfa 26 | asdfadffasdfasdf 27 | asdfadffasdfasdf 28 | afsdgag 29 | tuewhed 30 | dffasdfasdf 31 | asdfa 32 | asdfadffasdfasdf 33 | asdfadffasdfasdf 34 | afsdgag 35 | tuewhed 36 | dffasdfasdf -------------------------------------------------------------------------------- /Exercise/59/3/in_xfr_cl.c: -------------------------------------------------------------------------------- 1 | #include "in_xfr.h" 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | int sfd; 6 | ssize_t numRead; 7 | char buf[BUF_SIZE]; 8 | 9 | if ((sfd = inetConnect(argv[1], PORT_NUMBER, SOCK_STREAM)) == -1) 10 | errExit("inetConnect"); 11 | 12 | /* Copy stdin to socket */ 13 | 14 | while ((numRead = read(STDIN_FILENO, buf, BUF_SIZE)) > 0) 15 | if (write(sfd, buf, numRead) != numRead) 16 | fatal("partial/failed write"); 17 | 18 | if (numRead == -1) 19 | errExit("read"); 20 | 21 | exit(EXIT_SUCCESS); /* Closes our socket; server sees EOF */ 22 | } 23 | -------------------------------------------------------------------------------- /tlpi-dist/shlibs/demo_Bsymbolic/Makefile: -------------------------------------------------------------------------------- 1 | TARGETS = prog libfoo1.so libfoo2.so libfoo3.so 2 | 3 | all: ${TARGETS} 4 | 5 | run: 6 | LD_LIBRARY_PATH=. ./prog 7 | 8 | prog: prog.o libfoo1.so libfoo2.so libfoo3.so 9 | cc -g -o prog prog.c -L. -lfoo1 -lfoo2 -lfoo3 10 | 11 | libfoo1.so: 12 | cc -g -shared -fPIC -o libfoo1.so foo1.c 13 | 14 | libfoo2.so: 15 | cc -g -Wl,-Bsymbolic -shared -fPIC -o libfoo2.so foo2.c 16 | 17 | libfoo3.so: 18 | cc -g -Wl,-Bsymbolic -Wl,-allow-shlib-undefined \ 19 | -shared -fPIC -o libfoo3.so foo3.c 20 | 21 | clean: 22 | ${RM} ${TARGETS} *.o 23 | 24 | -------------------------------------------------------------------------------- /tlpi-dist/vdso/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = 4 | 5 | LINUX_EXE = vdso_gettimeofday syscall_gettimeofday 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | vdso_gettimeofday : gettimeofday.c 17 | ${CC} -o $@ gettimeofday.c ${CFLAGS} ${IMPL_LDLIBS} 18 | 19 | syscall_gettimeofday : gettimeofday.c 20 | ${CC} -DUSE_SYSCALL -o $@ gettimeofday.c ${CFLAGS} ${IMPL_LDLIBS} 21 | 22 | showall : 23 | @ echo ${EXE} 24 | 25 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 26 | -------------------------------------------------------------------------------- /tlpi-dist/altio/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = demo_sigio poll_pipes select_mq self_pipe t_select 4 | 5 | LINUX_EXE = epoll_flags_fork epoll_input multithread_epoll_wait 6 | 7 | EXE = ${GEN_EXE} ${LINUX_EXE} 8 | 9 | all : ${EXE} 10 | 11 | allgen : ${GEN_EXE} 12 | 13 | clean : 14 | ${RM} ${EXE} *.o 15 | 16 | showall : 17 | @ echo ${EXE} 18 | 19 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 20 | 21 | multithread_epoll_wait: multithread_epoll_wait.o 22 | ${CC} -o $@ multithread_epoll_wait.o \ 23 | ${CFLAGS} ${IMPL_LDLIBS} ${IMPL_THREAD_FLAGS} 24 | 25 | -------------------------------------------------------------------------------- /tlpi-dist/shlibs/version_scripts/sv_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # sv_build.sh 4 | # 5 | set -v 6 | 7 | # Build version 1 of shared library 8 | 9 | gcc -g -c -fPIC -Wall sv_lib_v1.c 10 | gcc -g -shared -o libsv.so sv_lib_v1.o -Wl,--version-script,sv_v1.map 11 | 12 | gcc -g -o p1 sv_prog.c libsv.so 13 | 14 | LD_LIBRARY_PATH=. ./p1 15 | 16 | # Build version 2 of shared library 17 | 18 | gcc -g -c -fPIC -Wall sv_lib_v2.c 19 | gcc -g -shared -o libsv.so sv_lib_v2.o -Wl,--version-script,sv_v2.map 20 | 21 | gcc -g -o p2 sv_prog.c libsv.so 22 | 23 | LD_LIBRARY_PATH=. ./p2 24 | LD_LIBRARY_PATH=. ./p1 25 | -------------------------------------------------------------------------------- /Exercise/23/23_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | unsigned int my_alarm(unsigned int seconds) 7 | { 8 | struct itimerval new, old; 9 | new.it_value.tv_sec = seconds; 10 | new.it_value.tv_usec = 0; 11 | new.it_interval.tv_sec = 0; 12 | new.it_interval.tv_usec = 0; 13 | 14 | setitimer(ITIMER_REAL, &new, &old); 15 | return old.it_value.tv_sec; 16 | } 17 | 18 | int main() 19 | { 20 | printf("%u\n", my_alarm(5)); 21 | printf("%u\n", my_alarm(2)); 22 | printf("%u\n", my_alarm(3)); 23 | 24 | for (;;) 25 | ; 26 | 27 | return 0; 28 | } -------------------------------------------------------------------------------- /Exercise/57/1/cl.c: -------------------------------------------------------------------------------- 1 | #include "u.h" 2 | #include 3 | 4 | int main() 5 | { 6 | int cfd; 7 | struct sockaddr_un svaddr; 8 | 9 | if ((cfd = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) 10 | errExit("socket"); 11 | 12 | memset(&svaddr, 0, sizeof(struct sockaddr_un)); 13 | svaddr.sun_family = AF_UNIX; 14 | strncpy(svaddr.sun_path, SOCKET_PATH, sizeof(svaddr.sun_path) - 1); 15 | 16 | for (int i = 0;; ++i) 17 | { 18 | printf("send %d\n", i); 19 | if (sendto(cfd, "a", 1, 0, (struct sockaddr *)&svaddr, sizeof(struct sockaddr_un)) != 1) 20 | errExit("sendto"); 21 | } 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /tlpi-dist/pmsg/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | GEN_EXE = mq_notify_sig mq_notify_sigwaitinfo mq_notify_thread \ 4 | mq_notify_via_signal mq_notify_via_thread \ 5 | pmsg_create pmsg_getattr pmsg_receive pmsg_send pmsg_unlink 6 | 7 | LINUX_EXE = 8 | 9 | EXE = ${GEN_EXE} ${LINUX_EXE} 10 | 11 | all : ${EXE} 12 | 13 | allgen : ${GEN_EXE} 14 | 15 | LDLIBS = ${IMPL_LDLIBS} ${LINUX_LIBRT} 16 | # All of the programs in this directory need the 17 | # realtime library, librt. 18 | 19 | clean : 20 | ${RM} ${EXE} *.o 21 | 22 | showall : 23 | @ echo ${EXE} 24 | 25 | ${EXE} : ${TLPI_LIB} # True as a rough approximation 26 | -------------------------------------------------------------------------------- /Exercise/18/2/18_2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "tlpi_hdr.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | int fd; 8 | 9 | if (mkdir("test", S_IRUSR | S_IWUSR | S_IXUSR) == -1) 10 | errExit("mkdir"); 11 | if (chdir("test") == -1) 12 | errExit("chdir"); 13 | fd = open("myfile", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); 14 | if (fd == -1) 15 | errExit("open"); 16 | if (close(fd) == -1) 17 | errExit("close"); 18 | if (symlink("test/myfile", "../mylink") == -1) 19 | errExit("symlink"); 20 | if (chmod("../mylink", S_IRUSR) == -1) 21 | errExit("chmod"); 22 | 23 | exit(EXIT_SUCCESS); 24 | } 25 | -------------------------------------------------------------------------------- /Exercise/44_?p743.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define MAXLINE 1024 6 | 7 | void err_exit(const char *msg) 8 | { 9 | printf("%s failed\n", msg); 10 | exit(EXIT_FAILURE); 11 | } 12 | 13 | int main() 14 | { 15 | int pfd[2]; 16 | char buf[MAXLINE]; 17 | if (pipe(pfd) == -1) 18 | err_exit("pipe"); 19 | 20 | FILE *wp = fdopen(pfd[1], "w"); 21 | FILE *rp = fdopen(pfd[0], "r"); 22 | 23 | fprintf(wp, "abc"); 24 | fflush(wp); 25 | // fscanf(rp, "%s", buf); 26 | read(pfd[0], buf, MAXLINE); 27 | 28 | printf("a\n"); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /Exercise/44_7.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | if (mkfifo("fifo", 0666) == -1) 8 | errExit("mkfifo"); 9 | 10 | // if (open("fifo", O_RDONLY) == -1) 11 | // errExit("open"); 12 | // if (open("fifo", O_RDONLY) == -1) 13 | // errExit("open"); 14 | 15 | if (open("fifo", O_RDONLY | O_NONBLOCK) == -1) 16 | errExit("open"); 17 | // if (open("fifo", O_WRONLY | O_NONBLOCK) == -1) 18 | // errExit("open"); 19 | if (open("fifo", O_WRONLY) == -1) 20 | errExit("open"); 21 | 22 | printf("end\n"); 23 | return 0; 24 | } -------------------------------------------------------------------------------- /Exercise/48/48_4/pr_shmid_ds.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | int shmid; 8 | struct shmid_ds ds; 9 | 10 | if (argc != 2) 11 | { 12 | printf("%s usage: shmid\n", argv[0]); 13 | exit(EXIT_SUCCESS); 14 | } 15 | shmid = atoi(argv[1]); 16 | 17 | if (shmctl(shmid, IPC_STAT, &ds) == -1) 18 | errExit("shmctl - IPC_STAT"); 19 | 20 | printf("key: %lx\nshmid: %d\nshm segsz: %ld\nshm nattch: %ld\n", 21 | (long)ds.shm_perm.__key, shmid, (long)ds.shm_segsz, (long)ds.shm_nattch); 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /Exercise/46_2/msg_seqnum.h: -------------------------------------------------------------------------------- 1 | #ifndef MSG_SEQNUM_H 2 | #define MSG_SEQNUM_H 3 | 4 | #include 5 | #include 6 | 7 | #define SERVER_FILE "/tmp/server_file_msg_seqnum_h" 8 | 9 | // note that this struct has padding bytes, using offsetof to deal with it 10 | struct RequestMsg 11 | { 12 | long mtype; 13 | pid_t pid; 14 | int seqlen; 15 | }; 16 | 17 | struct ResponseMsg 18 | { 19 | long mtype; 20 | int seqnum; 21 | }; 22 | 23 | #define REQUSET_SIZE (offsetof(struct RequestMsg, seqlen) - \ 24 | offsetof(struct RequestMsg, pid) + sizeof(int)) 25 | #define RESPONSE_SIZE (sizeof(int)) 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Exercise/57/0/cl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "und.h" 5 | 6 | int main() 7 | { 8 | int cfd; 9 | struct sockaddr_un unaddr; 10 | 11 | memset(&unaddr, 0, sizeof(struct sockaddr_un)); 12 | unaddr.sun_family = AF_UNIX; 13 | strncpy(unaddr.sun_path, SOCKET_PATH, sizeof(unaddr.sun_path) - 1); 14 | 15 | for (int i = 0;; ++i) 16 | { 17 | if ((cfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) 18 | errExit("socket"); 19 | 20 | printf("connet %d\n", i); 21 | if (connect(cfd, (struct sockaddr *)&unaddr, sizeof(struct sockaddr_un)) == -1) 22 | errExit("connect"); 23 | } 24 | 25 | return 0; 26 | } -------------------------------------------------------------------------------- /Exercise/47/47_4.h: -------------------------------------------------------------------------------- 1 | #ifndef BINARY_SEMS_H /* Prevent accidental double inclusion */ 2 | #define BINARY_SEMS_H 3 | 4 | #include "tlpi_hdr.h" 5 | 6 | /* Variables controlling operation of functions below */ 7 | 8 | extern Boolean bsUseSemUndo; /* Use SEM_UNDO during semop()? */ 9 | extern Boolean bsRetryOnEintr; /* Retry if semop() interrupted by 10 | signal handler? */ 11 | 12 | int initSemAvailable(int semId, int semNum); 13 | 14 | int initSemInUse(int semId, int semNum); 15 | 16 | int reserveSem(int semId, int semNum); 17 | 18 | int releaseSem(int semId, int semNum); 19 | 20 | int reserveSemNB(int semId, int semNum); 21 | 22 | #endif -------------------------------------------------------------------------------- /Exercise/47/47_6/binary_sems.h: -------------------------------------------------------------------------------- 1 | #ifndef BINARY_SEMS_H /* Prevent accidental double inclusion */ 2 | #define BINARY_SEMS_H 3 | 4 | #include "tlpi_hdr.h" 5 | 6 | /* Variables controlling operation of functions below */ 7 | 8 | extern Boolean bsUseSemUndo; /* Use SEM_UNDO during semop()? */ 9 | extern Boolean bsRetryOnEintr; /* Retry if semop() interrupted by 10 | signal handler? */ 11 | 12 | int initSemAvailable(int semId, int semNum); 13 | 14 | int initSemInUse(int semId, int semNum); 15 | 16 | int reserveSem(int semId, int semNum); 17 | 18 | int releaseSem(int semId, int semNum); 19 | 20 | int reserveSemNB(int semId, int semNum); 21 | 22 | #endif --------------------------------------------------------------------------------