Skip to content

Instantly share code, notes, and snippets.

@naehrwert
Created May 3, 2016 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naehrwert/92e24a4ac58a692752ca1565168f7a60 to your computer and use it in GitHub Desktop.
Save naehrwert/92e24a4ac58a692752ca1565168f7a60 to your computer and use it in GitHub Desktop.
int _ioctlv(int fd, int cmd, u32 num_in, u32 num_io, ioctlv_vec *vec, ...)
{
/* ... */
dev_ctxt *dev = get_dev(...);
u32 num_total = num_int + num_out;
/* ... */
if(num_total <= dev->max_vecs)
{
/* Copy in vectors if num_total <= 8 else use external vectors. */
/* Check vector buffer addrs. */
}
else
res = -11;
/* ... */
}
int _dev_register(char *path, int mqid, int pid)
{
/* ... */
dev->max_vecs = 8;
/* ... */
}
int syscall_2E_set_ioctlv_max_vecs(char *name, u16 num)
{
/* ... */
dev->max_vecs = num;
/* ... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment