mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-04-29 15:35:15 +00:00
macro: calculate buffer lengths correctly
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
54dcfd8160
commit
0c9b1f826d
@ -155,13 +155,30 @@
|
||||
* +
|
||||
* \0 = 1
|
||||
*/
|
||||
#define LXC_PROC_PID_FD_LEN (6 + INTTYPE_TO_STRLEN(pid_t) + 4 + INTTYPE_TO_STRLEN(int) + 1)
|
||||
#define LXC_PROC_PID_FD_LEN \
|
||||
(6 + INTTYPE_TO_STRLEN(pid_t) + 4 + INTTYPE_TO_STRLEN(int) + 1)
|
||||
|
||||
/* /proc/pid-to-str/status\0 = (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1) */
|
||||
#define LXC_PROC_STATUS_LEN (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1)
|
||||
/* /proc/ = 6
|
||||
* +
|
||||
* <pid-as-str> = INTTYPE_TO_STRLEN(pid_t)
|
||||
* +
|
||||
* /status = 7
|
||||
* +
|
||||
* \0 = 1
|
||||
*/
|
||||
#define LXC_PROC_STATUS_LEN (6 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1)
|
||||
|
||||
/* /proc/pid-to-str/attr/current = (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1) */
|
||||
#define LXC_LSMATTRLEN (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1)
|
||||
/* /proc/ = 6
|
||||
* +
|
||||
* <pid-as-str> = INTTYPE_TO_STRLEN(pid_t)
|
||||
* +
|
||||
* /attr/ = 6
|
||||
* +
|
||||
* /current = 8
|
||||
* +
|
||||
* \0 = 1
|
||||
*/
|
||||
#define LXC_LSMATTRLEN (6 + INTTYPE_TO_STRLEN(pid_t) + 6 + 8 + 1)
|
||||
|
||||
#define LXC_CMD_DATA_MAX (MAXPATHLEN * 2)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user