Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\helpers.c Create Date:2022-07-28 13:08:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__bpf_strtoull

Proto:static int __bpf_strtoull(const char *buf, size_t buf_len, u64 flags, unsigned long long *res, bool *is_negative)

Type:int

Parameter:

TypeParameterName
const char *buf
size_tbuf_len
u64flags
unsigned long long *res
bool *is_negative
367  base = flags & BPF_STRTOX_BASE_MASK
368  cur_buf = buf
369  cur_len = buf_len
374  If Not buf || Not buf_len || Not res || Not is_negative Then Return -EINVAL
377  If base != 0 && base != 8 && base != 10 && base != 16 Then Return -EINVAL
380  If flags & ~BPF_STRTOX_BASE_MASK Then Return -EINVAL
383  When cur_buf < buf + buf_len && Note: isspace() must return false for %NUL-terminator ( * cur_buf) cycle
384  ++cur_buf
386  is_negative = cur_buf < buf + buf_len && cur_buf == '-'
387  If is_negative Then ++cur_buf
390  consumed = cur_buf - buf
391  cur_len -= consumed
392  If Not cur_len Then Return -EINVAL
395  cur_len = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(cur_len, size of str - 1)
396  No 3D Now!(str, cur_buf, cur_len)
397  str[cur_len] = '\0'
398  cur_buf = str
400  cur_buf = _parse_integer_fixup_radix(cur_buf, & base)
401  val_len = Convert non-negative integer string representation in explicitly given radix* to an integer.* Return number of characters consumed maybe or-ed with overflow bit.* If overflow occurs, result integer (incorrect) is still returned.
403  If val_len & KSTRTOX_OVERFLOW Then Return -ERANGE
406  If val_len == 0 Then Return -EINVAL
409  cur_buf += val_len
410  consumed += cur_buf - str
412  Return consumed
Caller
NameDescribe
__bpf_strtoll
____bpf_strtoul