File: CODING_STYLE

package info (click to toggle)
systemd 44-11%2Bdeb7u4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 12,064 kB
  • sloc: ansic: 88,811; xml: 13,909; sh: 11,726; makefile: 2,075; python: 207; awk: 11
file content (27 lines) | stat: -rw-r--r-- 995 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

- 8ch indent, no tabs

- structs in MixedCase, variables, functions in lower_case

- the destructors always unregister the object from the next bigger
  object, not the other way around

- to minimize strict aliasing violations we prefer unions over casting

- for robustness reasons destructors should be able to destruct
  half-initialized objects, too

- error codes are returned as negative Exxx. i.e. return -EINVAL. There
  are some exceptions: for constructors its is OK to return NULL on
  OOM. For lookup functions NULL is fine too for "not found".

- Do not issue NSS requests (that includes user name and host name
  lookups) from the main daemon as this might trigger deadlocks when
  we those lookups involve synchronously talking to services that we
  would need to start up.

- Do not access any directories outside of /etc/, /dev, /lib from the
  init daemon to avoid deadlocks with the automounter.

- Don't synchronously talk to any other service, due to risk of
  deadlocks.