diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2018-03-06 18:44:11 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2018-03-06 18:44:11 +0100 |
commit | 2af099cae27fef1a57aa25d48fc915d619ea216d (patch) | |
tree | ff661aad6ab62c6db94b68a3eacba930ffb87881 /pcap_sg.c | |
parent | 18f5d4dde7ef18efa0489f2007f5ebeed89975ea (diff) |
all: drop fmem{cpy,set}
There is no need to explicity use the builtins. According to [1], GCC
will recognize mem{cpy,set} as built-in functions, unless the
corresponding -fno-builtin-* option is specified (which is not the case
for netsniff-ng).
[1] https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'pcap_sg.c')
-rw-r--r-- | pcap_sg.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -33,10 +33,10 @@ static ssize_t pcap_sg_write(int fd, pcap_pkthdr_t *phdr, enum pcap_type type, iov_slot = 0; } - fmemcpy(iov[iov_slot].iov_base, &phdr->raw, hdrsize); + memcpy(iov[iov_slot].iov_base, &phdr->raw, hdrsize); iov[iov_slot].iov_len = hdrsize; - fmemcpy(iov[iov_slot].iov_base + iov[iov_slot].iov_len, packet, len); + memcpy(iov[iov_slot].iov_base + iov[iov_slot].iov_len, packet, len); ret = (iov[iov_slot].iov_len += len); iov_slot++; @@ -57,7 +57,7 @@ static ssize_t __pcap_sg_inter_iov_hdr_read(int fd, pcap_pkthdr_t *phdr, bug_on(offset + remainder != hdrsize); - fmemcpy(&phdr->raw, iov[iov_slot].iov_base + iov_off_rd, offset); + memcpy(&phdr->raw, iov[iov_slot].iov_base + iov_off_rd, offset); iov_off_rd = 0; iov_slot++; @@ -68,7 +68,7 @@ static ssize_t __pcap_sg_inter_iov_hdr_read(int fd, pcap_pkthdr_t *phdr, return -EIO; } - fmemcpy(&phdr->raw + offset, iov[iov_slot].iov_base + iov_off_rd, remainder); + memcpy(&phdr->raw + offset, iov[iov_slot].iov_base + iov_off_rd, remainder); iov_off_rd += remainder; return hdrsize; @@ -87,7 +87,7 @@ static ssize_t __pcap_sg_inter_iov_data_read(int fd, uint8_t *packet, size_t hdr bug_on(offset + remainder != hdrlen); - fmemcpy(packet, iov[iov_slot].iov_base + iov_off_rd, offset); + memcpy(packet, iov[iov_slot].iov_base + iov_off_rd, offset); iov_off_rd = 0; iov_slot++; @@ -98,7 +98,7 @@ static ssize_t __pcap_sg_inter_iov_data_read(int fd, uint8_t *packet, size_t hdr return -EIO; } - fmemcpy(packet + offset, iov[iov_slot].iov_base + iov_off_rd, remainder); + memcpy(packet + offset, iov[iov_slot].iov_base + iov_off_rd, remainder); iov_off_rd += remainder; return hdrlen; @@ -111,7 +111,7 @@ static ssize_t pcap_sg_read(int fd, pcap_pkthdr_t *phdr, enum pcap_type type, size_t hdrsize = pcap_get_hdr_length(phdr, type), hdrlen; if (likely(iov[iov_slot].iov_len - iov_off_rd >= hdrsize)) { - fmemcpy(&phdr->raw, iov[iov_slot].iov_base + iov_off_rd, hdrsize); + memcpy(&phdr->raw, iov[iov_slot].iov_base + iov_off_rd, hdrsize); iov_off_rd += hdrsize; } else { ret = __pcap_sg_inter_iov_hdr_read(fd, phdr, hdrsize); @@ -124,7 +124,7 @@ static ssize_t pcap_sg_read(int fd, pcap_pkthdr_t *phdr, enum pcap_type type, return -EINVAL; if (likely(iov[iov_slot].iov_len - iov_off_rd >= hdrlen)) { - fmemcpy(packet, iov[iov_slot].iov_base + iov_off_rd, hdrlen); + memcpy(packet, iov[iov_slot].iov_base + iov_off_rd, hdrlen); iov_off_rd += hdrlen; } else { ret = __pcap_sg_inter_iov_data_read(fd, packet, hdrlen); |