Changeset 103024 in vbox for trunk/include
- Timestamp:
- Jan 24, 2024 1:37:01 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/string.h
r102999 r103024 244 244 #else /* !RT_OS_LINUX && !__KERNEL__ */ 245 245 # define RT_BCOPY_UNFORTIFIED(a_pDst, a_pSrc, a_cbToCopy) memcpy((a_pDst), (a_pSrc), (a_cbToCopy)) 246 #endif /* !RT_OS_LINUX && !__KERNEL__ */247 248 /** @def RT_STRSCPY249 * Copy string and NULL-terminate output buffer.250 *251 * This macro should mostly be used in Linux kernel code. This is252 * the replacement for deprecated strlcpy. It was deprecated since 4.3.0253 * when strscpy was introduced as an alternative. Finally, strlcpy was254 * completely removed from kernel code in 6.8.0.255 *256 * @param a_pDst Pointer to the destination string buffer.257 * @param a_pSrc Pointer to the source NULL-terminated string buffer.258 * @param a_cbDst Size of destination buffer.259 */260 #if defined(RT_OS_LINUX) && defined(__KERNEL__)261 # if (RTLNX_VER_MIN(4,3,0))262 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst) \263 { \264 ssize_t _ret; \265 _ret = strscpy((a_pDst), (a_pSrc), (a_cbDst)); \266 }267 # else /* < 4.3.0 */268 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst) strlcpy((a_pDst), (a_pSrc), (a_cbDst))269 # endif270 #else /* !RT_OS_LINUX && !__KERNEL__ */271 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst) strlcpy((a_pDst), (a_pSrc), (a_cbDst))272 246 #endif /* !RT_OS_LINUX && !__KERNEL__ */ 273 247
Note:
See TracChangeset
for help on using the changeset viewer.