> Siarzhuk Zharski <zharik@xxxxxx> wrote: > > Building my usb_scsi under Haiku I was warned that memset, memcpy > > functions have no prototypes. In KernelExports.h I found only > > user_memset, user_memcpy ones. Are any peculiarities using those > > mem* > > in > > kernel modules? Should I use user_mem* analogues instead? Are any > > technical details about it somewhere to read? Thanks! > > You can still just include <string.h> for those. > The user_*() versions have to be used whenever you're accessing > unsafe > user memory. In BeOS, the memory you get in read/write/etc. hooks is > already safe - but the one that got passed into ioctl() never was. Be > never published how to make memory safe, so you can use the user_*() > functions to access it. Actually they did once (is_valid_range(), in an example serial driver IIRC) but the prototype wasn't public and they didn't really used it much themselves, plus the is_valid_string() version was actually unsafe (only checked the first byte). François.