What does “whether synchronized I/O can be used with the associated file” mean?












0















From Advanced Programming in the UNIX® Environment:




For _PC_ASYNC_IO, _PC_PRIO_IO, and _PC_SYNC_IO, the referenced file
must not be a directory.




Name of option   |   Indicates ...                          |name argument
_POSIX_SYNC_IO |whether synchronized I/O can be used with |_PC_SYNC_IO
the associated file


So I assume the usage would be
long return_value = pathconf("/a/path/filename",_PC_SYNC_IO).



It looks like it's a way to get a specific file's "setting".



Is this thing can be set to a file? How can I set it?



And what does synchronized I/O mean as to a file? I mean, I don't understand how synchronized I/O could be a setting of a file? Shouldn't it be a programming aspect thing instead of merely a "setting"?










share|improve this question





























    0















    From Advanced Programming in the UNIX® Environment:




    For _PC_ASYNC_IO, _PC_PRIO_IO, and _PC_SYNC_IO, the referenced file
    must not be a directory.




    Name of option   |   Indicates ...                          |name argument
    _POSIX_SYNC_IO |whether synchronized I/O can be used with |_PC_SYNC_IO
    the associated file


    So I assume the usage would be
    long return_value = pathconf("/a/path/filename",_PC_SYNC_IO).



    It looks like it's a way to get a specific file's "setting".



    Is this thing can be set to a file? How can I set it?



    And what does synchronized I/O mean as to a file? I mean, I don't understand how synchronized I/O could be a setting of a file? Shouldn't it be a programming aspect thing instead of merely a "setting"?










    share|improve this question



























      0












      0








      0








      From Advanced Programming in the UNIX® Environment:




      For _PC_ASYNC_IO, _PC_PRIO_IO, and _PC_SYNC_IO, the referenced file
      must not be a directory.




      Name of option   |   Indicates ...                          |name argument
      _POSIX_SYNC_IO |whether synchronized I/O can be used with |_PC_SYNC_IO
      the associated file


      So I assume the usage would be
      long return_value = pathconf("/a/path/filename",_PC_SYNC_IO).



      It looks like it's a way to get a specific file's "setting".



      Is this thing can be set to a file? How can I set it?



      And what does synchronized I/O mean as to a file? I mean, I don't understand how synchronized I/O could be a setting of a file? Shouldn't it be a programming aspect thing instead of merely a "setting"?










      share|improve this question
















      From Advanced Programming in the UNIX® Environment:




      For _PC_ASYNC_IO, _PC_PRIO_IO, and _PC_SYNC_IO, the referenced file
      must not be a directory.




      Name of option   |   Indicates ...                          |name argument
      _POSIX_SYNC_IO |whether synchronized I/O can be used with |_PC_SYNC_IO
      the associated file


      So I assume the usage would be
      long return_value = pathconf("/a/path/filename",_PC_SYNC_IO).



      It looks like it's a way to get a specific file's "setting".



      Is this thing can be set to a file? How can I set it?



      And what does synchronized I/O mean as to a file? I mean, I don't understand how synchronized I/O could be a setting of a file? Shouldn't it be a programming aspect thing instead of merely a "setting"?







      files






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 21 at 15:36









      Stephen Kitt

      175k24400478




      175k24400478










      asked Feb 21 at 14:45









      RickRick

      24127




      24127






















          1 Answer
          1






          active

          oldest

          votes


















          2














          The result of pathconf can vary depending on the file, for some of the arguments it can be given (_PC_NAME_MAX, _PC_ASYNC_IO, and a few others), but for most arguments the result is a platform-dependent constant. The values you retrieve using pathconf aren’t per-file settings, they’re properties of the system and the type of file; you can’t set them.



          Synchronized I/O in this context refers to synchronous reads and writes from and to a file, as controlled by O_SYNC and related flags which can be specified on open calls. pathconf(..., _PC_SYNC_IO) will tell you whether those flags are supported (note that O_SYNC is always supposed to be supported on regular files anyway, regardless of the result of pathconf).






          share|improve this answer


























          • So no matter what file I put into pathconf("/no/matter/what/file",_PC_SYNC_IO), the result would be the same? That's ... Oh god, then why requires the first argument at all..?

            – Rick
            Feb 21 at 15:31













          • It’s a generic interface which supports a variety of settings, some of which are path-dependent (e.g. because they depend on the type of the file). You’re not really supposed to know ahead of time that any given setting is a constant ;-).

            – Stephen Kitt
            Feb 21 at 15:34











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502104%2fwhat-does-whether-synchronized-i-o-can-be-used-with-the-associated-file-mean%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          The result of pathconf can vary depending on the file, for some of the arguments it can be given (_PC_NAME_MAX, _PC_ASYNC_IO, and a few others), but for most arguments the result is a platform-dependent constant. The values you retrieve using pathconf aren’t per-file settings, they’re properties of the system and the type of file; you can’t set them.



          Synchronized I/O in this context refers to synchronous reads and writes from and to a file, as controlled by O_SYNC and related flags which can be specified on open calls. pathconf(..., _PC_SYNC_IO) will tell you whether those flags are supported (note that O_SYNC is always supposed to be supported on regular files anyway, regardless of the result of pathconf).






          share|improve this answer


























          • So no matter what file I put into pathconf("/no/matter/what/file",_PC_SYNC_IO), the result would be the same? That's ... Oh god, then why requires the first argument at all..?

            – Rick
            Feb 21 at 15:31













          • It’s a generic interface which supports a variety of settings, some of which are path-dependent (e.g. because they depend on the type of the file). You’re not really supposed to know ahead of time that any given setting is a constant ;-).

            – Stephen Kitt
            Feb 21 at 15:34
















          2














          The result of pathconf can vary depending on the file, for some of the arguments it can be given (_PC_NAME_MAX, _PC_ASYNC_IO, and a few others), but for most arguments the result is a platform-dependent constant. The values you retrieve using pathconf aren’t per-file settings, they’re properties of the system and the type of file; you can’t set them.



          Synchronized I/O in this context refers to synchronous reads and writes from and to a file, as controlled by O_SYNC and related flags which can be specified on open calls. pathconf(..., _PC_SYNC_IO) will tell you whether those flags are supported (note that O_SYNC is always supposed to be supported on regular files anyway, regardless of the result of pathconf).






          share|improve this answer


























          • So no matter what file I put into pathconf("/no/matter/what/file",_PC_SYNC_IO), the result would be the same? That's ... Oh god, then why requires the first argument at all..?

            – Rick
            Feb 21 at 15:31













          • It’s a generic interface which supports a variety of settings, some of which are path-dependent (e.g. because they depend on the type of the file). You’re not really supposed to know ahead of time that any given setting is a constant ;-).

            – Stephen Kitt
            Feb 21 at 15:34














          2












          2








          2







          The result of pathconf can vary depending on the file, for some of the arguments it can be given (_PC_NAME_MAX, _PC_ASYNC_IO, and a few others), but for most arguments the result is a platform-dependent constant. The values you retrieve using pathconf aren’t per-file settings, they’re properties of the system and the type of file; you can’t set them.



          Synchronized I/O in this context refers to synchronous reads and writes from and to a file, as controlled by O_SYNC and related flags which can be specified on open calls. pathconf(..., _PC_SYNC_IO) will tell you whether those flags are supported (note that O_SYNC is always supposed to be supported on regular files anyway, regardless of the result of pathconf).






          share|improve this answer















          The result of pathconf can vary depending on the file, for some of the arguments it can be given (_PC_NAME_MAX, _PC_ASYNC_IO, and a few others), but for most arguments the result is a platform-dependent constant. The values you retrieve using pathconf aren’t per-file settings, they’re properties of the system and the type of file; you can’t set them.



          Synchronized I/O in this context refers to synchronous reads and writes from and to a file, as controlled by O_SYNC and related flags which can be specified on open calls. pathconf(..., _PC_SYNC_IO) will tell you whether those flags are supported (note that O_SYNC is always supposed to be supported on regular files anyway, regardless of the result of pathconf).







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 21 at 15:25

























          answered Feb 21 at 14:57









          Stephen KittStephen Kitt

          175k24400478




          175k24400478













          • So no matter what file I put into pathconf("/no/matter/what/file",_PC_SYNC_IO), the result would be the same? That's ... Oh god, then why requires the first argument at all..?

            – Rick
            Feb 21 at 15:31













          • It’s a generic interface which supports a variety of settings, some of which are path-dependent (e.g. because they depend on the type of the file). You’re not really supposed to know ahead of time that any given setting is a constant ;-).

            – Stephen Kitt
            Feb 21 at 15:34



















          • So no matter what file I put into pathconf("/no/matter/what/file",_PC_SYNC_IO), the result would be the same? That's ... Oh god, then why requires the first argument at all..?

            – Rick
            Feb 21 at 15:31













          • It’s a generic interface which supports a variety of settings, some of which are path-dependent (e.g. because they depend on the type of the file). You’re not really supposed to know ahead of time that any given setting is a constant ;-).

            – Stephen Kitt
            Feb 21 at 15:34

















          So no matter what file I put into pathconf("/no/matter/what/file",_PC_SYNC_IO), the result would be the same? That's ... Oh god, then why requires the first argument at all..?

          – Rick
          Feb 21 at 15:31







          So no matter what file I put into pathconf("/no/matter/what/file",_PC_SYNC_IO), the result would be the same? That's ... Oh god, then why requires the first argument at all..?

          – Rick
          Feb 21 at 15:31















          It’s a generic interface which supports a variety of settings, some of which are path-dependent (e.g. because they depend on the type of the file). You’re not really supposed to know ahead of time that any given setting is a constant ;-).

          – Stephen Kitt
          Feb 21 at 15:34





          It’s a generic interface which supports a variety of settings, some of which are path-dependent (e.g. because they depend on the type of the file). You’re not really supposed to know ahead of time that any given setting is a constant ;-).

          – Stephen Kitt
          Feb 21 at 15:34


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502104%2fwhat-does-whether-synchronized-i-o-can-be-used-with-the-associated-file-mean%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to make a Squid Proxy server?

          第一次世界大戦

          Touch on Surface Book