svn commit: r261935 - projects/arm64/sys/boot/efi/libefi
Andrew Turner
andrew at FreeBSD.org
Sat Feb 15 16:17:39 UTC 2014
Author: andrew
Date: Sat Feb 15 16:17:38 2014
New Revision: 261935
URL: http://svnweb.freebsd.org/changeset/base/261935
Log:
Implement seek for the EFI Simple FS
Modified:
projects/arm64/sys/boot/efi/libefi/efisimplefs.c
Modified: projects/arm64/sys/boot/efi/libefi/efisimplefs.c
==============================================================================
--- projects/arm64/sys/boot/efi/libefi/efisimplefs.c Sat Feb 15 14:56:50 2014 (r261934)
+++ projects/arm64/sys/boot/efi/libefi/efisimplefs.c Sat Feb 15 16:17:38 2014 (r261935)
@@ -165,9 +165,35 @@ efifs_write(struct open_file *f, void *b
static off_t
efifs_seek(struct open_file *f, off_t offset, int where)
{
- printf("efifs_seek\n");
+ EFI_STATUS status;
+ EFI_FILE *file;
+ uint64_t pos;
+
+ file = f->f_fsdata;
+ if (file == NULL)
+ return (-1);
+
+ switch(where) {
+ case SEEK_SET:
+ pos = 0;
+ break;
+ case SEEK_CUR:
+ /* Read the current position first */
+ status = file->GetPosition(file, &pos);
+ if (EFI_ERROR(status))
+ return (-1);
+ break;
+ case SEEK_END:
+ default:
+ return (-1);
+ }
+
+ pos += offset;
+ status = file->SetPosition(file, pos);
+ if (EFI_ERROR(status))
+ return (-1);
- return (EINVAL);
+ return (pos);
}
static int
More information about the svn-src-projects
mailing list