unix 环境高级编程 勘误

来源:互联网 发布:微型linux 编辑:程序博客网 时间:2024/06/06 01:36

The following errors were fixed in the second printing.

  1. Page 413, third paragraph. If a signal is related to an expiring timer, it 
    is sent to an arbitrary thread, not necessarily to the thread that scheduled the 
    timer. Hardware-related signals are usually delivered to the thread generating 
    the fault (FreeBSD 5.2.1 seems to depart from this is some cases, however). Look 
    here for some test programs that illustrate the 
    behavior of signals with multithreaded processes. 
  2. Page 67, sentence before Section 3.7. The size is 2GB, not 2TB. 
  3. Page 523, Figure 15.26. The largest message we can send on FreeBSD 5.2.1 is 
    2048 bytes. The kernel limits this value to the maximum size in bytes allowed on 
    a queue. 
  4. Page 367, Figure 11.6. pthread_cancel_push should 
    be pthread_cleanup_push
  5. Page 382, last sentence on page. pthread_mutex_destroy should be pthread_cond_destroy
  6. Page 357, function prototype for pthread_create
    The argument for the start routine is a void *, not a 
    void
  7. Page 158, near bottom of page. tempfile should be 
    tmpfile
  8. Page 853, solution to exercise 1.3. ptr should be 
    msg to make it consistent with the function prototype 
    for perror shown earlier in the book. 
     

The following errors were fixed in the third printing.

  1. Page 194, function prototypes for setenv and unsetenv. These functions return -1 on error, which is more 
    specific than simply a nonzero return value. 
  2. Page 306, Figure 10.4. The Corrigenda for the Single UNIX Specification 
    added abort and sockatmark 
    to the list of reentrant functions. 
  3. Page 361, middle of page. The discussion of pthread_join has been cleaned up, making it clear which 
    thread is placed in the detached state and that it is implementation-specific 
    whether this function fails. 
  4. Page 365, Example at end of page. "nonzero" should be "zero." 
  5. Page 367, middle of page. The behavior of implementations varies concerning 
    whether cleanup handlers are called if a thread returns from its start routine. 
  6. Page 367, end of page. pthread_join for a detached 
    thread might not fail in some implementations, so change "will" to "can." 
  7. Page 374, middle of page. fh[idx] = fp->f_next should be fh[idx] = fp. Actually, I should apologize for this one. I've written 
    this logic (correctly) so many times that I have no good excuse for getting it 
    wrong this time. Same problem occurs again near the top of page 377. 
  8. Page 374, end of page. In the statement idx = HASH(fp) at the beginning of 
    foo_findfp is undefined at 
    this point. The correct thing to do is to search every hash chain to find a 
    matching ID. Same problem occurs again in the middle of page 377. 
  9. Page 391, function prototype for pthread_attr_setstack. Remove the const type qualifier. 
  10. Pages 414-415, Figure 12.16. Change the variable wait to waitloc to allow 
    compilation on some platforms. 
  11. Page 599, Figure 17.16. The variable len should be 
    declared to be of type socklen_t
  12. Pages 849 and 851 (Figures B.3 and B.4). The snprintf and vsnprintf calls 
    should specify one byte less than the size of the buffer to prevent overwriting 
    the byte after the end of the buffer with a newline.  

Here are the errors not yet fixed in any printing:

  1. Page 255, top of page. ac_flag should be ac_stat
  2. Page 14, first paragraph. The statement that all threads in a process share 
    the same stacks is a little misleading: each thread executes on its own stack, 
    although any thread can access the stack of the other threads in the process, 
    because the address space is shared among the threads. 
  3. Page 701, last paragraph. Figure 15.8 should be Figure 15.19. 
    注意:很多的和中文版的页码对不上的。现在看到十一章线程部分 程序清单11-6和11-7中的foo_alloc(void)函数中的第十二行应该改为fh[index]=fp;这个对应着上面勘误中的15.以后还会继续更正,争取和中文版的对应起来
             我又发现了新的问题,就是在中文版的apue中的11-7中的foo_alloc(void)中的/*...continue initialization**/之后应该是忘记加上pthread_mutex_unlock(&fp->f_lock);              
             个人感觉p363的程序14-4有些问题。我觉得在TELL_PARENT(),WAIT_PARENT(),TELL_CHILD(),WAIT_PARENT()这几个函数的顺序可能有些问题,感觉有可能在
锁定文件之前就造成死锁。。


0 0