全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Async-signal-safe function?

Definition 14.11 University Computer Science — Year 2 · 第 14 章 — Files, Pipes and Signals

A function is async-signal-safe when it can be called safely from within a signal handler. POSIX lists them: write, _exit, waitpid and most plain system calls are; printf, malloc and anything that takes a lock or touches a shared buffer are not.

A signal’s delivery. Sent, it is pending until the kernel next returns to the process in user mode; the handler then runs on the process’s stack, and when it returns the program goes on as if nothing had happened, except what the handler changed.
A signal’s delivery. Sent, it is pending until the kernel next returns to the process in user mode; the handler then runs on the process’s stack, and when it returns the program goes on as if nothing had happened, except what the handler changed.
在原文中阅读 →