the code is questionable. I am unsure what you are trying to do, but I see several concerns.
that creates an array of 100 slots where each slot is a pointer to a char
I suspect, you intend to declare it instead to be:
later in the code, you pass buf to sysfile_write. buf means the pointer to the first element of buf. So its a pointer to a pointer. And that’s weird. Not what you probably want to give to sysfile_write.
Also, the 2nd param to sysfile_write should be a pointer to a long. Therefore, I would declare it to be:
and then call it like this:
err = sysfile_write(fh, &count, buf);