Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syscalls: create sys_statvfs syscalls #631

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

badochov
Copy link
Contributor

@badochov badochov commented Jan 17, 2025

JIRA: RTOS-965

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

@badochov badochov requested a review from Darchiv January 17, 2025 13:07
posix/posix.c Outdated Show resolved Hide resolved
posix/posix.c Outdated Show resolved Hide resolved
posix/posix.c Outdated Show resolved Hide resolved
@badochov badochov force-pushed the badochov/sys_statvfs branch 2 times, most recently from 9ea9d85 to b22533e Compare January 17, 2025 13:23
@@ -23,6 +23,7 @@
#include "include/posix-poll.h"
#include "include/posix-socket.h"
#include "include/posix-stat.h"
#include "include/posix-statvfs.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this file included in the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad

posix/posix.h Outdated
@@ -77,6 +78,9 @@ extern int posix_chmod(const char *path, mode_t mode);
extern int posix_fstat(int fd, struct stat *buf);


extern int posix_statvfs(const char *path, int fd, struct statvfs *buf);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In posix.c, the last argument is called stat, not buf

posix/posix.c Outdated
msg.i.attr.type = atMode;

if ((proc_send(oidp->port, &msg) < 0) || (msg.o.err < 0)) {
(void)posix_fileDeref(f);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if f is used uninitialized? If posix_getOpenFile() is performed with &f, then devp == NULL, so this branch isn't even taken when f is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@badochov badochov force-pushed the badochov/sys_statvfs branch from b22533e to 890bf16 Compare January 21, 2025 10:47
@badochov badochov force-pushed the badochov/sys_statvfs branch from 890bf16 to c213150 Compare January 21, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants