Skip to content

Commit

Permalink
Compilation fixes for FreeBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin authored and kr committed Apr 19, 2011
1 parent a9419cb commit 5cb605b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net.c
Expand Up @@ -14,12 +14,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <netinet/tcp.h>
#include <netdb.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include "dat.h"
#include "sd-daemon.h"

Expand Down
Empty file added net_freebsd.c
Empty file.
38 changes: 38 additions & 0 deletions port_freebsd.c
@@ -0,0 +1,38 @@
/* Copyright 2011 Keith Rarick
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include "dat.h"

static char buf0[512]; /* buffer of zeros */

int
falloc(int fd, int len)
{
int i, w;

for (i = 0; i < len; i += w) {
w = write(fd, buf0, sizeof buf0);
if (w == -1) return errno;
}

lseek(fd, 0, 0); /* do not care if this fails */

return 0;
}
2 changes: 2 additions & 0 deletions prot.c
Expand Up @@ -25,6 +25,8 @@
#include <errno.h>
#include <sys/resource.h>
#include <sys/uio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <ctype.h>
#include <inttypes.h>
Expand Down

0 comments on commit 5cb605b

Please sign in to comment.