Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-32776

'getmntinfo64' has been explicitly marked deprecated here

Details

    Description

      I am getting the following error while compiling MariaDB source code:

      server/plugin/disks/information_schema_disks.cc:154:12: error: 'getmntinfo64' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
          count= getmntinfo64(&s, MNT_WAIT);
                 ^
      /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/sys/mount.h:422:9: note: 'getmntinfo64' has been explicitly marked deprecated here
      int     getmntinfo64(struct statfs64 **, int) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
              ^
      1 error generated.
      ninja: build stopped: subcommand failed.
      

      Attachments

        Activity

          danblack Daniel Black added a comment - - edited

          So from this it looks like just getmntinfo is needed?

          heyingquan Can you try a patch like:

          diff --git a/plugin/disks/CMakeLists.txt b/plugin/disks/CMakeLists.txt
          index 4e40842cad0..1880518590f 100644
          --- a/plugin/disks/CMakeLists.txt
          +++ b/plugin/disks/CMakeLists.txt
          @@ -4,7 +4,6 @@ CHECK_SYMBOL_EXISTS (getmntent "mntent.h" HAVE_GETMNTENT)
           CHECK_SYMBOL_EXISTS (getmntent "sys/mnttab.h" HAVE_GETMNTENT_IN_SYS_MNTAB)
           CHECK_SYMBOL_EXISTS (setmntent "mntent.h" HAVE_SETMNTENT)
           CHECK_SYMBOL_EXISTS (getmntinfo "sys/types.h;sys/mount.h" HAVE_GETMNTINFO)
          -CHECK_SYMBOL_EXISTS (getmntinfo64 "sys/types.h;sys/mount.h" HAVE_GETMNTINFO64)
           
           IF (HAVE_GETMNTINFO)
           CHECK_CXX_SOURCE_COMPILES("
          diff --git a/plugin/disks/information_schema_disks.cc b/plugin/disks/information_schema_disks.cc
          index bfae81eceac..a9ed3c5623d 100644
          --- a/plugin/disks/information_schema_disks.cc
          +++ b/plugin/disks/information_schema_disks.cc
          @@ -37,8 +37,7 @@
             This intends to support *BSD's, macOS, Solaris, AIX, HP-UX, and Linux.
           
             specificly:
          -  FreeBSD/OpenBSD/DragonFly (statfs) NetBSD (statvfs) uses getmntinfo().
          -  macOS uses getmntinfo64().
          +  FreeBSD/OpenBSD/DragonFly/macOS (statfs) NetBSD (statvfs) uses getmntinfo().
             Linux can use getmntent_r(), but we've just used getmntent for simplification.
             Linux/Solaris/AIX/HP-UX uses setmntent()/getmntent().
             Solaris uses getmntent() with a diffent prototype, return structure, and
          @@ -148,8 +147,6 @@ static int disks_fill_table(THD* pThd, TABLE_LIST* pTables, Item* pCond)
           
           #if defined(HAVE_GETMNTINFO_TAKES_statvfs)
               count= getmntinfo(&s, ST_WAIT);
          -#elif defined(HAVE_GETMNTINFO64)
          -    count= getmntinfo64(&s, MNT_WAIT);
           #else
               count= getmntinfo(&s, MNT_WAIT);
           #endif
          
          

          danblack Daniel Black added a comment - - edited So from this it looks like just getmntinfo is needed? heyingquan Can you try a patch like: diff --git a/plugin/disks/CMakeLists.txt b/plugin/disks/CMakeLists.txt index 4e40842cad0..1880518590f 100644 --- a/plugin/disks/CMakeLists.txt +++ b/plugin/disks/CMakeLists.txt @@ -4,7 +4,6 @@ CHECK_SYMBOL_EXISTS (getmntent "mntent.h" HAVE_GETMNTENT) CHECK_SYMBOL_EXISTS (getmntent "sys/mnttab.h" HAVE_GETMNTENT_IN_SYS_MNTAB) CHECK_SYMBOL_EXISTS (setmntent "mntent.h" HAVE_SETMNTENT) CHECK_SYMBOL_EXISTS (getmntinfo "sys/types.h;sys/mount.h" HAVE_GETMNTINFO) -CHECK_SYMBOL_EXISTS (getmntinfo64 "sys/types.h;sys/mount.h" HAVE_GETMNTINFO64) IF (HAVE_GETMNTINFO) CHECK_CXX_SOURCE_COMPILES(" diff --git a/plugin/disks/information_schema_disks.cc b/plugin/disks/information_schema_disks.cc index bfae81eceac..a9ed3c5623d 100644 --- a/plugin/disks/information_schema_disks.cc +++ b/plugin/disks/information_schema_disks.cc @@ -37,8 +37,7 @@ This intends to support *BSD's, macOS, Solaris, AIX, HP-UX, and Linux. specificly: - FreeBSD/OpenBSD/DragonFly (statfs) NetBSD (statvfs) uses getmntinfo(). - macOS uses getmntinfo64(). + FreeBSD/OpenBSD/DragonFly/macOS (statfs) NetBSD (statvfs) uses getmntinfo(). Linux can use getmntent_r(), but we've just used getmntent for simplification. Linux/Solaris/AIX/HP-UX uses setmntent()/getmntent(). Solaris uses getmntent() with a diffent prototype, return structure, and @@ -148,8 +147,6 @@ static int disks_fill_table(THD* pThd, TABLE_LIST* pTables, Item* pCond) #if defined(HAVE_GETMNTINFO_TAKES_statvfs) count= getmntinfo(&s, ST_WAIT); -#elif defined(HAVE_GETMNTINFO64) - count= getmntinfo64(&s, MNT_WAIT); #else count= getmntinfo(&s, MNT_WAIT); #endif
          heyingquan Yingquan He added a comment - - edited

          Hi, @Daniel.
          Your advice is valid.
          I have tested it on both the 10.4 and 11.1 branches, and it works.

          heyingquan Yingquan He added a comment - - edited Hi, @Daniel. Your advice is valid. I have tested it on both the 10.4 and 11.1 branches, and it works.
          danblack Daniel Black added a comment -

          Dmitry, can you review https://github.com/MariaDB/server/pull/2836 please.

          danblack Daniel Black added a comment - Dmitry, can you review https://github.com/MariaDB/server/pull/2836 please.
          shulga Dmitry Shulga added a comment -

          Approved

          shulga Dmitry Shulga added a comment - Approved
          danblack Daniel Black added a comment -

          Thank you.

          danblack Daniel Black added a comment - Thank you.

          People

            danblack Daniel Black
            heyingquan Yingquan He
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.