Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/string.h
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | if (len >= dstlen) { | ||||
memcpy(dst, src, dstlen); | memcpy(dst, src, dstlen); | ||||
} else { | } else { | ||||
memcpy(dst, src, len); | memcpy(dst, src, len); | ||||
/* Pad with given padding character. */ | /* Pad with given padding character. */ | ||||
memset((char *)dst + len, ch, dstlen - len); | memset((char *)dst + len, ch, dstlen - len); | ||||
} | } | ||||
} | } | ||||
#define memset_startat(ptr, bytepat, smember) \ | |||||
({ \ | |||||
uint8_t *_ptr = (uint8_t *)(ptr); \ | |||||
int _c = (int)(bytepat); \ | |||||
size_t _o = offsetof(typeof(*(ptr)), smember); \ | |||||
memset(_ptr + _o, _c, sizeof(*(ptr)) - _o); \ | |||||
}) | |||||
#endif /* _LINUXKPI_LINUX_STRING_H_ */ | #endif /* _LINUXKPI_LINUX_STRING_H_ */ |