MCPcopy Create free account
hub / github.com/apache/nuttx / rpmsgfs_client_open

Function rpmsgfs_client_open

fs/rpmsgfs/rpmsgfs_client.c:426–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424 ****************************************************************************/
425
426int rpmsgfs_client_open(FAR void *handle, FAR const char *pathname,
427 int flags, int mode)
428{
429 FAR struct rpmsgfs_s *priv = handle;
430 FAR struct rpmsgfs_open_s *msg;
431 uint32_t space;
432 size_t len;
433
434 len = sizeof(*msg) + strlen(pathname) + 1;
435
436 msg = rpmsgfs_get_tx_payload_buffer(priv, &space);
437 if (!msg)
438 {
439 return -ENOMEM;
440 }
441
442 DEBUGASSERT(len <= space);
443
444 msg->flags = flags;
445 msg->mode = mode;
446 strlcpy(msg->pathname, pathname, space - sizeof(*msg));
447
448 return rpmsgfs_send_recv(priv, RPMSGFS_OPEN, false,
449 (struct rpmsgfs_header_s *)msg, len, NULL);
450}
451
452int rpmsgfs_client_close(FAR void *handle, int fd)
453{

Callers 1

rpmsgfs_openFunction · 0.85

Calls 4

rpmsgfs_send_recvFunction · 0.85
strlenFunction · 0.50
strlcpyFunction · 0.50

Tested by

no test coverage detected