-
Notifications
You must be signed in to change notification settings - Fork 63
Add FreeBSD platforms' build. #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /******************************************************************************* | ||
| * Copyright (c) 2018, 2023 Cedric Chabanois and others. | ||
| * Copyright (c) 2018, 2025 Cedric Chabanois and others. | ||
| * | ||
| * This program and the accompanying materials | ||
| * are made available under the terms of the Eclipse Public License 2.0 | ||
|
|
@@ -11,6 +11,7 @@ | |
| * Contributors: | ||
| * Cedric Chabanois (cchabanois@gmail.com) - Launching command line exceeds the process creation command limit on *nix - https://bugs.eclipse.org/bugs/show_bug.cgi?id=385738 | ||
| * IBM Corporation - Launching command line exceeds the process creation command limit on Windows - https://bugs.eclipse.org/bugs/show_bug.cgi?id=327193 | ||
| * Tue Ton - support for FreeBSD | ||
| *******************************************************************************/ | ||
| package org.eclipse.jdt.internal.launching; | ||
|
|
||
|
|
@@ -54,9 +55,11 @@ | |
| */ | ||
| public class ClasspathShortener implements IProcessTempFileCreator { | ||
| private static final String CLASSPATH_ENV_VAR_PREFIX = "CLASSPATH="; //$NON-NLS-1$ | ||
| public static final int ARG_MAX_FREEBSD = 2097152; | ||
| public static final int ARG_MAX_LINUX = 2097152; | ||
| public static final int ARG_MAX_WINDOWS = 32767; | ||
| public static final int ARG_MAX_MACOS = 262144; | ||
| public static final int MAX_ARG_STRLEN_FREEBSD = 131072; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possible to reuse |
||
| public static final int MAX_ARG_STRLEN_LINUX = 131072; | ||
| private final String os; | ||
| private final String javaVersion; | ||
|
|
@@ -261,6 +264,9 @@ protected int getMaxCommandLineLength() { | |
| // POSIX suggests to subtract 2048 additionally so that the process may safely modify its environment. | ||
| // see https://www.in-ulm.de/~mascheck/various/argmax/ | ||
| switch (os) { | ||
| case Platform.OS_FREEBSD: | ||
| // ARG_MAX will be 1/4 of the stack size. 2097152 by default | ||
| return ARG_MAX_FREEBSD - getEnvironmentLength() - 2048; | ||
| case Platform.OS_LINUX: | ||
| // ARG_MAX will be 1/4 of the stack size. 2097152 by default | ||
| return ARG_MAX_LINUX - getEnvironmentLength() - 2048; | ||
|
|
@@ -277,6 +283,11 @@ protected int getMaxCommandLineLength() { | |
| } | ||
|
|
||
| protected int getMaxArgLength() { | ||
| if (os.equals(Platform.OS_FREEBSD)) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks similar to |
||
| // On FreeBSD, MAX_ARG_STRLEN is the maximum length of a command line argument (or environment variable). | ||
| // Its value cannot be changed without recompiling the kernel. | ||
| return MAX_ARG_STRLEN_FREEBSD - 2048; | ||
| } | ||
| if (os.equals(Platform.OS_LINUX)) { | ||
| // On Linux, MAX_ARG_STRLEN (kernel >= 2.6.23) is the maximum length of a command line argument (or environment variable). Its value | ||
| // cannot be changed without recompiling the kernel. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARG_MAX_FREEBSD&ARG_MAX_LINUXhave identical values, can you reuseARG_MAX_LINUXfor freeBSD ?