[commit][3470] Integrate Monty's support for the fsync primitive.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit][3470] Integrate Monty's support for the fsync primitive.

commits-3
 
Revision: 3470
Author:   eliot
Date:     2015-10-04 09:50:28 -0700 (Sun, 04 Oct 2015)
Log Message:
-----------
Integrate Monty's support for the fsync primitive.

Modified Paths:
--------------
    trunk/platforms/Cross/plugins/FilePlugin/FilePlugin.h
    trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c

Property Changed:
----------------
    trunk/platforms/Cross/plugins/sqPluginsSCCSVersion.h

Modified: trunk/platforms/Cross/plugins/FilePlugin/FilePlugin.h
===================================================================
--- trunk/platforms/Cross/plugins/FilePlugin/FilePlugin.h 2015-10-02 19:29:46 UTC (rev 3469)
+++ trunk/platforms/Cross/plugins/FilePlugin/FilePlugin.h 2015-10-04 16:50:28 UTC (rev 3470)
@@ -52,6 +52,7 @@
 sqInt   sqFileValid(SQFile *f);
 size_t  sqFileWriteFromAt(SQFile *f, size_t count, char* byteArrayIndex, size_t startIndex);
 sqInt   sqFileFlush(SQFile *f);
+sqInt   sqFileSync(SQFile *f);
 sqInt   sqFileTruncate(SQFile *f,squeakFileOffsetType offset);
 sqInt   sqFileThisSession(void);
 sqInt   sqFileStdioHandlesInto(SQFile files[3]);
@@ -61,10 +62,25 @@
 sqInt dir_Create(char *pathString, sqInt pathStringLength);
 sqInt dir_Delete(char *pathString, sqInt pathStringLength);
 sqInt dir_Delimitor(void);
+#if PharoVM
 sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
  /* outputs: */
  char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
+ sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt *posixPermissions, sqInt *isSymlink);
+sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString, sqInt nameStringLength,
+ /* outputs: */
+ char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
+ sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt *posixPermissions, sqInt *isSymlink);
+#else
+sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
+ /* outputs: */
+ char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
  sqInt *isDirectory, squeakFileOffsetType *sizeIfFile);
+sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString, sqInt nameStringLength,
+ /* outputs: */
+ char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
+ sqInt *isDirectory, squeakFileOffsetType *sizeIfFile);
+#endif
 sqInt dir_PathToWorkingDir(char *pathName, sqInt pathNameMax);
 sqInt dir_SetMacFileTypeAndCreator(char *filename, sqInt filenameSize, char *fType, char *fCreator);
 sqInt dir_GetMacFileTypeAndCreator(char *filename, sqInt filenameSize, char *fType, char *fCreator);

Modified: trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
===================================================================
--- trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c 2015-10-02 19:29:46 UTC (rev 3469)
+++ trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c 2015-10-04 16:50:28 UTC (rev 3470)
@@ -487,6 +487,17 @@
 }
 
 sqInt
+sqFileSync(SQFile *f) {
+
+ if (!sqFileValid(f))
+ return interpreterProxy->success(false);
+ pentry(sqFileSync);
+ if (fsync(fileno(getFile(f))) != 0)
+ return interpreterProxy->success(false);
+ return 1;
+}
+
+sqInt
 sqFileTruncate(SQFile *f,squeakFileOffsetType offset) {
 
  if (!sqFileValid(f))


Property changes on: trunk/platforms/Cross/plugins/sqPluginsSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Wed Sep 23 11:09:06 PDT 2015
   + Sun Oct  4 09:50:05 PDT 2015