惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
博客园_首页
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
D
Docker
博客园 - 司徒正美
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
U
Unit 42
J
Java Code Geeks
A
About on SuperTechFans
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security Affairs
I
Intezer
Cisco Talos Blog
Cisco Talos Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog RSS Feed
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
T
Threatpost
H
Hacker News: Front Page
G
Google Developers Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
S
Secure Thoughts
GbyAI
GbyAI
NISL@THU
NISL@THU
S
Security @ Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
O
OpenAI News
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog

Solaris

请问有人做过 sun 服务器的虚拟化吗 - V2EX 最新的Solaris 11.1 X86是什么授权了? - V2EX
这两天为 libhv 做了 Solaris 的适配,两点小感受 - V2EX
CismonX · 2020-05-06 · via Solaris

CismonX

 

CismonX · 2020 年 5 月 6 日 · 5591 次点击

这是一个创建于 2231 天前的主题,其中的信息可能已经有所发展或是发生改变。

第一点,Solaris 的 event ports API 设计的可谓是非常简洁优雅了,用起来很舒服,一气呵成。不像之前用 kqueue 的时候,各种踩坑。

第二点,C 语言项目中的一大问题就是对全局命名空间的污染。在为 libhv 适配 Solaris 的时候,发现项目作者对命名不是非常讲究,导致与一些系统 API 命名冲突。比如 sockaddr_un,比如 gethrtime()。当这样的问题出现在库中时,有时会让用户很头疼,因为命名随意很有可能导致它们与其他的库也可能会有冲突。

所以我在自己的 C 项目中,一般是这样做的:

  1. 暴露给调用方的头文件中,所有的定义与声明(包括宏定义)都用项目名(或者其缩写)作为前缀,如 libxxx_do_something()LIBXXX_MAX_FOO_SIZE
  2. 永远不 typedef struct/union/enum 。

附 PR 链接: https://github.com/ithewei/libhv/pull/4