[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH 3/3] lib/vfscore: Import posix_fadvise() from OsV



Fix implemented in patch 736795, It should be upstreamed before this
one, so there are no build errors.

Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@xxxxxxxxx>

On Thu, Nov 28, 2019 at 10:57 AM Stefan Teodorescu
<stefanl.teodorescu@xxxxxxxxx> wrote:
>
> This doesn't work if I select newlib, instead of nolibc. The macros
> used in the switch statement are defined in
> unikraft/lib/nolibc/include/fcntl.h. When I don't include nolib
> anymore, and use newlib, these are not found and I get a compilation
> error.
>
> On Tue, Nov 26, 2019 at 7:18 PM Costin Lupu <costin.lupu@xxxxxxxxx> wrote:
> >
> > Copied and tabified from official OsV git repo
> > https://github.com/cloudius-systems/osv.git, commit ee7a2cd4.
> >
> > Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
> > ---
> >  lib/vfscore/exportsyms.uk |  1 +
> >  lib/vfscore/main.c        | 17 +++++++++++++++++
> >  2 files changed, 18 insertions(+)
> >
> > diff --git a/lib/vfscore/exportsyms.uk b/lib/vfscore/exportsyms.uk
> > index 225cd730..2b8bd43d 100644
> > --- a/lib/vfscore/exportsyms.uk
> > +++ b/lib/vfscore/exportsyms.uk
> > @@ -118,3 +118,4 @@ utimensat
> >  futimens
> >  utimes
> >  lutimes
> > +posix_fadvise
> > diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
> > index 4e99911f..cf84a0e0 100644
> > --- a/lib/vfscore/main.c
> > +++ b/lib/vfscore/main.c
> > @@ -2058,6 +2058,23 @@ ssize_t sendfile(int out_fd, int in_fd, off_t 
> > *_offset, size_t count)
> >  LFS64(sendfile);
> >  #endif
> >
> > +int posix_fadvise(int fd __unused, off_t offset __unused, off_t len 
> > __unused,
> > +               int advice)
> > +{
> > +       switch (advice) {
> > +       case POSIX_FADV_NORMAL:
> > +       case POSIX_FADV_SEQUENTIAL:
> > +       case POSIX_FADV_RANDOM:
> > +       case POSIX_FADV_NOREUSE:
> > +       case POSIX_FADV_WILLNEED:
> > +       case POSIX_FADV_DONTNEED:
> > +               return 0;
> > +       default:
> > +               return EINVAL;
> > +       }
> > +}
> > +LFS64(posix_fadvise);
> > +
> >  mode_t umask(mode_t newmask)
> >  {
> >         return ukarch_exchange_n(&global_umask, newmask);
> > --
> > 2.20.1
> >

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.