summaryrefslogtreecommitdiffstats
path: root/osdep/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/io.c')
-rw-r--r--osdep/io.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/osdep/io.c b/osdep/io.c
index 819cdcbf69..b93618400c 100644
--- a/osdep/io.c
+++ b/osdep/io.c
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License along
* with mplayer2. If not, see <http://www.gnu.org/licenses/>.
*/
+#define MP_HIDE_IO_REPLACEMENTS
#include <unistd.h>
#include <errno.h>
@@ -395,4 +396,14 @@ char *mp_getenv(const char *name)
return NULL;
}
+off_t mp_lseek(int fd, off_t offset, int whence)
+{
+ HANDLE h = (HANDLE)_get_osfhandle(fd);
+ if (h != INVALID_HANDLE_VALUE && GetFileType(h) != FILE_TYPE_DISK) {
+ errno = ESPIPE;
+ return (off_t)-1;
+ }
+ return lseek(fd, offset, whence);
+}
+
#endif // __MINGW32__